[PATCH v5] branch: introduce --show-current display option

2018-10-25 Thread Daniels Umanovskis
When called with --show-current, git branch will print the current branch name and terminate. Only the actual name gets printed, without refs/heads. In detached HEAD state, nothing is output. Intended both for scripting and interactive/informative use. Unlike git branch --list, no filtering is nee

Re: [PATCH v5] branch: introduce --show-current display option

2018-10-25 Thread Eric Sunshine
On Thu, Oct 25, 2018 at 3:04 PM Daniels Umanovskis wrote: > When called with --show-current, git branch will print the current > branch name and terminate. Only the actual name gets printed, > without refs/heads. In detached HEAD state, nothing is output. > > Signed-off-by: Daniels Umanovskis > -

Re: [PATCH v5] branch: introduce --show-current display option

2018-10-25 Thread Junio C Hamano
Eric Sunshine writes: >> + test_when_finished "git tag -d branch-and-tag-name" && >> + git tag branch-and-tag-name && > > If git-tag crashes before actually creating the new tag, then "git tag > -d", passed to test_when_finished(), will error out too, which is > probably undesirable s

Re: [PATCH v5] branch: introduce --show-current display option

2018-10-25 Thread Junio C Hamano
Eric Sunshine writes: >> + test_when_finished " >> + git checkout branch-one >> + git branch -D branch-and-tag-name >> + " && >> + git checkout -b branch-and-tag-name && >> + test_when_finished "git tag -d branch-and-tag-name" && >> + git

Re: [PATCH v5] branch: introduce --show-current display option

2018-11-01 Thread Jeff King
On Fri, Oct 26, 2018 at 09:52:24AM +0900, Junio C Hamano wrote: > Eric Sunshine writes: > > >> + test_when_finished "git tag -d branch-and-tag-name" && > >> + git tag branch-and-tag-name && > > > > If git-tag crashes before actually creating the new tag, then "git tag > > -d", passed