Re: Bug: git branch returns EXIT_SUCCESS when no branches found
- From
- Christoffer Stjernlöf <a@xkqr.org>
- Date
- Apr 24, 2019, 10:47 UTC
- Message-ID
- <871s1rissy.fsf@xkqr.org>
- In-Reply-To
- <xmqqmukf1yh9.fsf@gitster-ct.c.googlers.com>
Dear Junio,
Junio C Hamano (gitster@pobox.com) 2019-04-24:
> This invocation is not in line with how "git branch" subcommand is > designed to work.
This is fair. I completely accept a "you're wielding it wrong" answer! However, your explanation sounds to me like that invocation is exactly in line with how git branch is designed to work! What might I be missing?
Junio C Hamano (gitster@pobox.com) 2019-04-24:
Show 10 quoted lines
> If you want to ask "does the tip of $DEV_BRANCH reach commit > 'master'?", the right way would probably be to ask > > if git merge-base --is-ancestor master "$DEV_BRANCH" > then > echo "master is an ancestor of $DEV_BRANCH" > else > echo "master has commits not in $DEV_BRANCH"B > git --no-pager log "master..$DEV_BRANCH" -- > fi
This seems like a more convenient command for my current purpose, although it's not a complete replacement for git branch. Thank you!
Sincerely yours, Christoffer