Re: Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread SZEDER Gábor
On Wed, Apr 24, 2019 at 07:36:34PM +0900, Junio C Hamano wrote: > 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" > git --no-pa

Re: Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread Christoffer Stjernlöf
Dear Junio, Junio C Hamano (gits...@pobox.com) 2019-04-24: > if cs/topic branch does not exist, of if the branch > does not contain 'master', the command will show "here are the > branches that match the criteria you gave me" by giving no lines in > its standard output, and exits with 0 to signal

Re: Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread Christoffer Stjernlöf
Dear Junio, Junio C Hamano (gits...@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

Re: Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread Junio C Hamano
Junio C Hamano writes: > The list mode ... > ... can > also limit the branches whose tip commits can reach a named commit > with the "--contains". > > $ DEV_BRANCH=cs/topic > $ git branch --contains master "$DEV_BRANCH" > > asks the subcommand to show only the branches that can reach

Re: Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread Junio C Hamano
a...@xkqr.org (Christoffer Stjernlöf) writes: > A common use case of git branch – for me – is to use it to test whether > a particular branch satisfies some conditions. A recent example is this: > > if ! git branch "$DEV_BRANCH" --contains master; then This invocation is not in line with how

Bug: git branch returns EXIT_SUCCESS when no branches found

2019-04-24 Thread Christoffer Stjernlöf
Dear Sirs/Madams, A common use case of git branch – for me – is to use it to test whether a particular branch satisfies some conditions. A recent example is this: if ! git branch "$DEV_BRANCH" --contains master; then echo "The development branch ($DEV_BRANCH) is not up to date"