From: Christian Couder Date: Tue, 06 Jan 2015 17:37:34 GMT Subject: Re: Additional plumbing commands Message-ID: In-Reply-To: On Tue, Jan 6, 2015 at 5:05 PM, Charles Rudolph wrote: > 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.