What is the difference between "git whatchanged - filename" and "git rev-list - filename"

What is the difference between the two commands below. I see different results.
Both are made from a clone with one branch.

git whatchanged -m -- foo.c git rev-list --reverse --all -- foo.c 
+6
source share
1 answer

As mentioned in the git whatchanged man page :

Shows commit logs and diff output, each input of which is entered.
The command internally calls git rev-list with the number git diff-tree and takes command line parameters for both of these commands.

"Connected to git diff-tree " will explain the different output between both commands.

You can find an example of git rev-list in combination with git diff in In git, how can I get the difference between all commits that occurred between two dates? "


September 2013 update:

The new version of the man page for git whatchanged now emphasizes :

New users are advised to use git log . The whatchanged command is essentially the same as git log , but the output of the raw format diff is displayed by default and skips merges.

The team is kept mostly for historical reasons; the fingers of many people who learned git long before git log were invented by reading the Linux kernel mailing list learn to enter it.

See the section Difference between git-log and git-whatchanged . "

+3
source

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


All Articles