Re: Additional plumbing commands
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jan 6, 2015, 17:37 UTC
- Message-ID
- <CAP8UFD1OZ1QjHRyNGVs0Vm52=Ue-ta1gBzNxLpX25NSCbtu9EQ@mail.gmail.com>
- In-Reply-To
- <CA+SVznFFPED+ms=4abNpvNQx-nt6imDMJtYKuNBTTLzCJ547Vw@mail.gmail.com>
On Tue, Jan 6, 2015 at 5:05 PM, Charles Rudolph <charles.w.rudolph@gmail.com> wrote:
Show 11 quoted lines
> I am writing some higher level git commands for > https://github.com/Originate/git-town and would like some additional > plumbing commands that can tell me > > 1. is there a merge in progress? > 2. is there a rebase in progress? > 3. is there a cherry-pick in progress? > 4. are there unmerged paths? > > Currently the only way I know how to do this is with "git status" and > looking for specific text.
You may have a look at how "contrib/completion/git-prompt.sh" does it. It has stuff like:
if [ -d "$g/rebase-merge" ]; then
__git_eread "$g/rebase-merge/head-name" b
__git_eread "$g/rebase-merge/msgnum" step
__git_eread "$g/rebase-merge/end" total
if [ -f "$g/rebase-merge/interactive" ]; then
r="|REBASE-i"
else
r="|REBASE-m"
fi
...Cheers, Christian.