@@ -3,47 +3,56 @@ package git
33import "github.com/codemodify/sc/spec"
44
55var (
6- git_cmdConfigList = []string {"git" , "config" , "--list" }
7- git_cmdRepoInfoTopLevel = []string {"git" , "rev-parse" , "--show-toplevel" }
8- git_cmdRepoInfoCurrentBranch = []string {"git" , "rev-parse" , "--abbrev-ref" , "HEAD" }
9- git_cmdRepoInfoIsBare = []string {"git" , "rev-parse" , "--is-bare-repository" }
10- git_cmdRepoInfoOriginURL = []string {"git" , "remote" , "get-url" , "origin" }
11- git_cmdRepoInit = []string {"git" , "init" }
12- git_cmdRepoClone = []string {"git" , "clone" }
13- git_cmdFetchBranches = []string {"git" , "fetch" , "--no-tags" }
14- git_cmdFetchTags = []string {"git" , "fetch" , "--tags" }
6+ git_cmdConfigListGlobal = []string {"git" , "config" , "--global" , "--list" }
7+ git_cmdConfigListLocal = []string {"git" , "config" , "--local" , "--list" }
8+ git_cmdConfigSet = []string {"git" , "config" }
9+
10+ git_cmdRepoInfoTopLevel = []string {"git" , "rev-parse" , "--show-toplevel" }
11+ git_cmdRepoInfoCurrentBranch = []string {"git" , "rev-parse" , "--abbrev-ref" , "HEAD" }
12+ git_cmdRepoInfoIsBare = []string {"git" , "rev-parse" , "--is-bare-repository" }
13+ git_cmdRepoInfoOriginURL = []string {"git" , "remote" , "get-url" , "origin" }
14+ git_cmdRepoInit = []string {"git" , "init" }
15+ git_cmdRepoClone = []string {"git" , "clone" }
16+
1517 git_cmdBranchListLocal = []string {"git" , "branch" }
1618 git_cmdBranchListRemote = []string {"git" , "branch" , "-r" }
17- git_cmdBranchLocalToRemote = []string {"git" , "for-each-ref " , "--format=%(refname:short)->%(upstream:short)" , "refs/heads " }
18- git_cmdBranchSwitch = []string {"git" , "switch " }
19+ git_cmdBranchListRemoteFetch = []string {"git" , "fetch " , "--no-tags " }
20+ git_cmdBranchListLocalToRemote = []string {"git" , "for-each-ref" , "--format=%(refname:short)->%(upstream:short)" , "refs/heads " }
1921 git_cmdBranchCreate = []string {"git" , "switch" , "-c" } // create and switch
2022 git_cmdBranchCreateFromExisting = []string {"git" , "switch" , "-c" } // create and switch "new-branch" from "existing-branch"
2123 git_cmdBranchDeleteLocal = []string {"git" , "branch" , "-d" }
2224 git_cmdBranchDeleteLocalForce = []string {"git" , "branch" , "-D" } // if there are unmerged commits
2325 git_cmdBranchDeleteRemote = []string {"git" , "push" , "origin" , "--delete" }
26+ git_cmdBranchSwitch = []string {"git" , "switch" }
2427 git_cmdBranchMerge = []string {"git" , "merge" }
2528 git_cmdBranchRebase = []string {"git" , "rebase" }
26- git_cmdChangeList = []string {"git" , "status" }
27- git_cmdChangeDiff = []string {"git" , "diff" }
28- git_cmdChangeDiffFile = []string {"git" , "diff" , "--" }
29- git_cmdChangeAdd = []string {"git" , "add" }
30- git_cmdChangeRemove = []string {"git" , "restore" , "--staged" , "--" }
31- git_cmdChangeReset = []string {"git" , "restore" , "--source" , "HEAD" , "--staged" , "--worktree" , "--" }
32- git_cmdCommitSave = []string {"git" , "commit" , "-m" }
33- git_cmdCommitList = []string {"git" , "log" , "--oneline" , "--decorate" }
34- git_cmdCommitPull = []string {"git" , "pull" }
35- git_cmdCommitPush = []string {"git" , "push" }
36- git_cmdCommitUndo = []string {"git" , "revert" , "--no-edit" }
37- git_cmdHeadVerify = []string {"git" , "rev-parse" , "--verify" , "HEAD" }
38- git_cmdStashList = []string {"git" , "stash" , "list" , "--format=%gd\t %gs" }
39- git_cmdStashPush = []string {"git" , "stash" , "push" , "-m" }
40- git_cmdStashDrop = []string {"git" , "stash" , "drop" }
41- git_cmdRestoreFromSource = []string {"git" , "restore" , "--source" }
42- git_cmdTagList = []string {"git" , "tag" , "--list" }
43- git_cmdTagPull = []string {"git" , "fetch" , "--tags" }
44- git_cmdTagCreate = []string {"git" , "tag" }
45- git_cmdTagDelete = []string {"git" , "tag" , "-d" }
46- git_cmdTagPush = []string {"git" , "push" , "--tags" }
29+ git_cmdBranchPRBranch = []string {"git" , "rev-parse" , "--abbrev-ref" , "HEAD" }
30+ git_cmdBranchPROriginHead = []string {"git" , "symbolic-ref" , "--quiet" , "--short" , "refs/remotes/origin/HEAD" }
31+
32+ git_cmdCommitList = []string {"git" , "log" , "--oneline" , "--decorate" }
33+ git_cmdCommitPull = []string {"git" , "pull" }
34+ git_cmdCommitUndo = []string {"git" , "reset" , "--soft" , "HEAD~1" } // []string{"git", "revert", "--no-edit"}
35+ git_cmdCommitSave = []string {"git" , "commit" , "-m" }
36+ git_cmdCommitPush = []string {"git" , "push" }
37+ git_cmdCommitHeadVerify = []string {"git" , "rev-parse" , "--verify" , "HEAD" }
38+
39+ git_cmdChangeList = []string {"git" , "status" }
40+ git_cmdChangeAdd = []string {"git" , "add" }
41+ git_cmdChangeRemove = []string {"git" , "restore" , "--staged" , "--" }
42+ git_cmdChangeReset = []string {"git" , "restore" , "--source" , "HEAD" , "--staged" , "--worktree" , "--" }
43+ git_cmdChangeDiff = []string {"git" , "diff" }
44+ git_cmdChangeDiffFile = []string {"git" , "diff" , "--" }
45+
46+ git_cmdStashList = []string {"git" , "stash" , "list" , "--format=%gd\t %gs" }
47+ git_cmdStashAdd = []string {"git" , "stash" , "push" , "-m" }
48+ git_cmdStashRemove = []string {"git" , "restore" , "--source" }
49+ git_cmdStashDelete = []string {"git" , "stash" , "drop" }
50+
51+ git_cmdTagList = []string {"git" , "tag" , "--list" }
52+ git_cmdTagPull = []string {"git" , "fetch" , "--tags" }
53+ git_cmdTagCreate = []string {"git" , "tag" }
54+ git_cmdTagDelete = []string {"git" , "tag" , "-d" }
55+ git_cmdTagPush = []string {"git" , "push" , "--tags" }
4756)
4857
4958type git struct {}
0 commit comments