1
1
mirror of https://github.com/kahole/edamagit.git synced 2024-08-15 18:20:30 +03:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Kristian Andersen Hole
0fd309db0a changelog 2024-03-25 18:30:28 +01:00
Kristian Andersen Hole
cce3727048
Merge pull request #290 from bezbac/develop
Adds support for `magit-branch-spinoff`
2024-03-25 18:28:01 +01:00
Kristian Andersen Hole
d02ed6fd95
Merge pull request #293 from garymm/develop
Set --no-ext-diff when running git diff
2024-03-25 18:27:22 +01:00
Gary Miguel
4ee6091b36
Set --no-ext-diff when running git diff
If a user has the following set in their git config:

```properties
[diff]
  external = difft
```

edmagit will fail to parse the `git diff` output. This should fix that.

Fixes https://github.com/kahole/edamagit/issues/228
2024-03-25 10:08:15 -07:00
Ben Bachem
1a323ef4fa
adds support for magit-branch-spinoff 2024-03-07 16:34:29 +01:00
5 changed files with 25 additions and 5 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## [0.6.60]
- Set --no-ext-diff when running git diff, supporting configs with other diff tools (#228). (@garymm Gary Miguel)
- Adds `magit-branch-spinoff` command (@bezbac Ben Bachem)
## [0.6.56]
- adds `git -c diff.noprefix=false` to raw commands (adressing #276)
- check cursor-word chooseRef is actually a commit, otherwise throw away

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "magit",
"version": "0.6.59",
"version": "0.6.60",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "magit",
"version": "0.6.59",
"version": "0.6.60",
"license": "MIT",
"dependencies": {
"@vscode/iconv-lite-umd": "^0.7.0",

View File

@ -7,7 +7,7 @@
"author": {
"name": "Kristian Andersen Hole"
},
"version": "0.6.59",
"version": "0.6.60",
"engines": {
"vscode": "^1.50.0"
},

View File

@ -15,7 +15,7 @@ const branchingCommands = [
{ label: 'c', description: 'Checkout new branch', action: checkoutNewBranch },
// { label: "w", description: "Checkout new worktree", action: checkout },
// { label: "y", description: "Checkout pull-request", action: checkout },
// { label: "s", description: "Create new spin-off", action: createNewSpinoff },
{ label: 's', description: 'Create new spin-off', action: createNewSpinoff },
{ label: 'n', description: 'Create new branch', action: createNewBranch },
// { label: "W", description: "Create new worktree", action: checkout },
// { label: "Y", description: "Create from pull-request", action: checkout },
@ -201,3 +201,19 @@ async function _createBranch({ repository }: MenuState, checkout: boolean) {
}
}
}
async function createNewSpinoff({ repository }: MenuState) {
const newBranchName = await window.showInputBox({
prompt: 'Name for new branch',
});
if (newBranchName && newBranchName.length > 0) {
const args = ['checkout', '-B', newBranchName];
return gitRun(repository.gitRepository, args);
} else {
window.setStatusBarMessage(
'No name given for new branch',
Constants.StatusMessageDisplayTimeout
);
}
}

View File

@ -82,7 +82,7 @@ async function diffWorktree({ repository }: MenuState) {
}
async function diff(repository: MagitRepository, id: string, args: string[] = []) {
const diffResult = await gitRun(repository.gitRepository, ['diff', ...args]);
const diffResult = await gitRun(repository.gitRepository, ['diff', '--no-ext-diff', ...args]);
const uri = DiffView.encodeLocation(repository, id);
return ViewUtils.showView(uri, new DiffView(uri, diffResult.stdout));