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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Junio,

Junio C Hamano (gitster@xxxxxxxxx) 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@xxxxxxxxx) 2019-04-24:
> 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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux