git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Charles RudolphNext: Jeff King
Message 2 of 4 in “Additional plumbing commands”
  1. Charles RudolphJan 6, 2015
  2. Christian CouderJan 6, 2015
  3. Jeff KingJan 7, 2015
  4. Junio C HamanoJan 7, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.