mirror of
https://github.com/kahole/edamagit.git
synced 2024-10-26 09:00:54 +03:00
Compare commits
4 Commits
f026de4e19
...
cc51974ce9
Author | SHA1 | Date | |
---|---|---|---|
|
cc51974ce9 | ||
|
12617656c6 | ||
|
3f66cd1cb5 | ||
|
153b0d6751 |
@ -1,5 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [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
|
||||||
|
- develop adds `no verify` switch to merging commands
|
||||||
|
|
||||||
## [0.6.55]
|
## [0.6.55]
|
||||||
- Fixes loss of fold functionality with CommitDetail due to overwriting the registered view
|
- Fixes loss of fold functionality with CommitDetail due to overwriting the registered view
|
||||||
|
|
||||||
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "magit",
|
"name": "magit",
|
||||||
"version": "0.6.55",
|
"version": "0.6.56",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "magit",
|
"name": "magit",
|
||||||
"version": "0.6.55",
|
"version": "0.6.56",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vscode/iconv-lite-umd": "^0.7.0",
|
"@vscode/iconv-lite-umd": "^0.7.0",
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
"author": {
|
"author": {
|
||||||
"name": "Kristian Andersen Hole"
|
"name": "Kristian Andersen Hole"
|
||||||
},
|
},
|
||||||
"version": "0.6.55",
|
"version": "0.6.56",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.50.0"
|
"vscode": "^1.50.0"
|
||||||
},
|
},
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import * as Constants from '../common/constants';
|
||||||
import { ViewColumn, window } from 'vscode';
|
import { ViewColumn, window } from 'vscode';
|
||||||
import { MenuState, MenuUtil } from '../menu/menu';
|
import { MenuState, MenuUtil } from '../menu/menu';
|
||||||
import { PickMenuUtil } from '../menu/pickMenu';
|
import { PickMenuUtil } from '../menu/pickMenu';
|
||||||
@ -195,7 +196,8 @@ async function _createBranch({ repository }: MenuState, checkout: boolean) {
|
|||||||
return gitRun(repository.gitRepository, args);
|
return gitRun(repository.gitRepository, args);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('No name given for new branch');
|
|
||||||
|
window.setStatusBarMessage('No name given for new branch', Constants.StatusMessageDisplayTimeout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ export async function merging(repository: MagitRepository) {
|
|||||||
const switches = [
|
const switches = [
|
||||||
{ key: '-f', name: '--ff-only', description: 'Fast-forward only' },
|
{ key: '-f', name: '--ff-only', description: 'Fast-forward only' },
|
||||||
{ key: '-n', name: '--no-ff', description: 'No fast-forward' },
|
{ key: '-n', name: '--no-ff', description: 'No fast-forward' },
|
||||||
|
{ key: '-n', name: '--no-verify', description: 'Disable hooks' },
|
||||||
];
|
];
|
||||||
|
|
||||||
if (repository.mergingState) {
|
if (repository.mergingState) {
|
||||||
|
@ -18,3 +18,5 @@ export enum SemanticTokenTypes {
|
|||||||
RemoteHeadName = 'magit-remote-head-name',
|
RemoteHeadName = 'magit-remote-head-name',
|
||||||
TagName = 'magit-tag-name',
|
TagName = 'magit-tag-name',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const GitConfigOverrideArgs = ['-c', 'diff.noprefix=false'];
|
@ -5,6 +5,7 @@ import { findGit } from './findGit';
|
|||||||
import * as iconv from '@vscode/iconv-lite-umd';
|
import * as iconv from '@vscode/iconv-lite-umd';
|
||||||
import { dispose, IDisposable, toDisposable } from './disposable';
|
import { dispose, IDisposable, toDisposable } from './disposable';
|
||||||
import { magitConfig } from '../../extension';
|
import { magitConfig } from '../../extension';
|
||||||
|
import { GitConfigOverrideArgs } from '../../common/constants';
|
||||||
|
|
||||||
const canceledName = 'Canceled';
|
const canceledName = 'Canceled';
|
||||||
class CancellationError extends Error {
|
class CancellationError extends Error {
|
||||||
@ -179,7 +180,7 @@ async function _exec(args: string[], options: SpawnOptions = {}): Promise<IExecu
|
|||||||
}
|
}
|
||||||
|
|
||||||
const git = await findGit(pathHints, () => true);
|
const git = await findGit(pathHints, () => true);
|
||||||
const child = spawn(git.path, args, options);
|
const child = spawn(git.path, [...GitConfigOverrideArgs, ...args], options);
|
||||||
|
|
||||||
// options.onSpawn?.(child);
|
// options.onSpawn?.(child);
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import { RefType, Repository } from '../typings/git';
|
|||||||
import { PickMenuItem, PickMenuUtil } from '../menu/pickMenu';
|
import { PickMenuItem, PickMenuUtil } from '../menu/pickMenu';
|
||||||
import GitTextUtils from '../utils/gitTextUtils';
|
import GitTextUtils from '../utils/gitTextUtils';
|
||||||
import * as Constants from '../common/constants';
|
import * as Constants from '../common/constants';
|
||||||
|
import { getCommit } from './commitCache';
|
||||||
|
|
||||||
export interface Selection {
|
export interface Selection {
|
||||||
key: string;
|
key: string;
|
||||||
@ -150,24 +151,31 @@ export default class MagitUtils {
|
|||||||
|
|
||||||
public static async chooseRef(repository: MagitRepository, prompt: string, showCurrent = false, showHEAD = false, allowFreeform = true, remoteOnly = false): Promise<string> {
|
public static async chooseRef(repository: MagitRepository, prompt: string, showCurrent = false, showHEAD = false, allowFreeform = true, remoteOnly = false): Promise<string> {
|
||||||
|
|
||||||
const getCursorCommitHash: () => PickMenuItem<string> | undefined = () => {
|
const getCursorCommitHash: () => Promise<PickMenuItem<string> | undefined> = async () => {
|
||||||
const activeEditor = vscode.window.activeTextEditor;
|
const activeEditor = vscode.window.activeTextEditor;
|
||||||
if (activeEditor === undefined) {
|
if (activeEditor === undefined) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
const document = activeEditor.document;
|
const document = activeEditor.document;
|
||||||
const selection = activeEditor.selection;
|
const selection = activeEditor.selection;
|
||||||
const hashWordRange = document.getWordRangeAtPosition(selection.active, /[0-9a-z]{7}/);
|
const hashWordRange = document.getWordRangeAtPosition(selection.active, /[0-9a-z]{7}/);
|
||||||
if (hashWordRange === undefined) {
|
if (hashWordRange === undefined) {
|
||||||
return;
|
return undefined;
|
||||||
}
|
}
|
||||||
const hash = document.getText(hashWordRange);
|
const hash = document.getText(hashWordRange);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await getCommit(repository.gitRepository, hash);
|
||||||
|
} catch (error) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return { label: hash, meta: hash };
|
return { label: hash, meta: hash };
|
||||||
};
|
};
|
||||||
|
|
||||||
const refs: PickMenuItem<string>[] = [];
|
const refs: PickMenuItem<string>[] = [];
|
||||||
|
|
||||||
const cursorCommitHash = getCursorCommitHash();
|
const cursorCommitHash = await getCursorCommitHash();
|
||||||
|
|
||||||
if (cursorCommitHash) {
|
if (cursorCommitHash) {
|
||||||
refs.push(cursorCommitHash);
|
refs.push(cursorCommitHash);
|
||||||
|
Loading…
Reference in New Issue
Block a user