In what version of Git did git -status get the --branch option?

In the latest version of git, you can use the --branch (or -b) flag to "Show branch and tracking information even in a short format."

When (which version) did git make this option? I know that at least 1.7.0.4 is not an option.

+1
source share
2 answers

The combination of git grep -F and git log --oneline -S is usually a powerful way to dig something out of a Git repo:
( manojlds offers one liner in its answer , which should work most of the time if you are looking for the right comment, such as the OP question. Go upvote it).

 VonC@NETVONC ~/Prog/git/git (master) $ git grep -F 'Show the branch' Documentation/git-status.txt: Show the branch and tracking info even in short-format. VonC@NETVONC ~/Prog/git/git (master) $ git log --oneline --follow -S'Show the branch' -- Documentation/git-status.txt 46077fa Documentation+t5708: document and test status -s -b VonC@NETVONC ~/Prog/git/git (master) $ git tag --contains 46077fa ko-maint ko-master ko-next ko-pu v1.7.2 

So 1.7.2

(I always found this thread a neat drawing of git digging)


Note. 233 commits were introduced after 1.7.1 according to git describe :

 VonC@NETVONC ~/Prog/git/git (master) $ git describe 46077fa v1.7.1-233-g46077fa 

It was first introduced on Tuesday May 25 16:52:03 2010 +0200

 VonC@NETVONC ~/Prog/git/git (master) $ git show 46077fa commit 46077fa5d477a3e96e0bb96042a2a9fdc9c818cb Author: Michael J Gruber < git@drmicha.warpmail.net > Date: Tue May 25 16:52:03 2010 +0200 Documentation+t5708: document and test status -s -b Signed-off-by: Michael J Gruber < git@drmicha.warpmail.net > Signed-off-by: Junio C Hamano < gitster@pobox.com > 
+3
source

I usually look for strings and look for them in the release notes (so you know exactly which release only one command has been added to):

Something like this works:

 $ git grep -F "shows the current branch" Documentation/RelNotes/1.7.2.txt: * "git status -s -b" shows the current branch 

Clearly, it was added in 1.7.2. Of course, you need to play with words, but you can use regular expressions to find them easier.

You can do a similar search using the advanced github search, so you don't have to clone the source.

You can do the following:

 repo:git/git path:Documentation/RelNotes/* <what you want to find> 

to search for release notes online

+2
source

Source: https://habr.com/ru/post/1396139/


All Articles