git-log

Git and binary files history

筅森魡賤 提交于 2019-12-06 06:25:15
This is a follow up on some similar " answered " questions about git handling binary files and how git can't follow file history very well . So, git can't properly follow file history . Heck, even git log --follow -M100% --name-only -- path-to-my-file won't do it, and I'm supposedly telling it to only follow files that are 100% similar! Then we are supposed to use other ways to find who to blame , such as bisecting . Problem here is: those doesn't seem to work with binaries. And accodring to Linus we are unlikely to get a git log --follow fully working any time soon. In the end my question

How can I limit the log to all the descendants of a given commit?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 00:33:36
问题 Given the history X-Y <- feature / A-B-C-D-E <- master I want to get the descendants of a given commit. One solution seems to be: git log --all --ancestry-path <ref>^! However, the behaviour is a bit strange: when <rev> is C , the result is CDEXY when <rev> is D or X , the result is DEXY (weird!) when <rev> is E , the result is E My understanding is that the command does not get all children of <rev> ; instead, it gets all children of parent-of(ref). Am I right? This is unintuitive, error

How do I use vim as 'git log' editor?

耗尽温柔 提交于 2019-12-05 19:28:52
问题 When I run git log , what exactly is the editor git log is using? Also: Is there anyway I can use vim as my default editor for git log ? If I want to search against the git log, what's the best way? Now I'm doing something like: git log | grep bla . 回答1: The git log command pipes it's output by default into a pager , not an editor. This pager is usually less or more on most systems. You can change the default pager to vim with the command: git config --global core.pager 'vim -' Now you can

What flags need to be set on `git log` to make it have similar output to `git whatchanged`?

◇◆丶佛笑我妖孽 提交于 2019-12-05 19:05:23
Per: Difference between git-log and git-whatchanged? Encourage new users to use 'log' instead. These days, these commands are unified and just have different defaults. I only recently discovered git whatchanged but found its output: commit deadbeefdeadbeefdeadbeefdeadbeefdeadbeef Author: Egg Sample <mail@example.com> Date: Mon Jan 28 16:32:04 2019 -0800 change some files :100777 100644 abaddad1 feeb1e42 M src/changemymode.txt :100644 100644 1234abcd abcd1234 M src/changemycontent.txt :000000 100755 00000000 6600abcd A src/addme.txt :100755 000000 feed1bee 00000000 D src/deleteme.txt useful for

git – order commits introducing “TODO”s by date

僤鯓⒐⒋嵵緔 提交于 2019-12-05 16:40:55
I want to find commits that introduced added a "TODO" or "FIXME" comment and order them by date. I know that git log -G'TODO|FIXME' will show me commits that contain either comment and I could do something like git log --format='%ci' -G'TODO|FIXME' | cut -d' ' -f 1 But this will not respect that it should only be commits introducing such comments. Does anyone know how I can find only commits introducing such comments and order them by date? If the actual SHA-1 was included in that list, that would be even more awesome. Andrew C This should get you closer. It isn't clear what you mean by "order

View full file diff of `x` commits of a single file's history (that's hosted in git)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 13:54:42
Say I have a file in git called filex.code , and I want to see the full code of the last x versions of that file with each changed section highlighted -- all in one place. So an x -paned commit history of filex.code , almost as if I were doing an x -paned diff, but viewing historical versions rather than merging from different branches. The greater x , the better. Crossplatform would be great, but any of the Big Three works. Being able to edit the latest version would also be great, but read-only visualization is plenty. Note that this is different from a simple history of commits to a file,

Ignore files in git log -p

好久不见. 提交于 2019-12-05 13:35:29
I'm trying to summarize my work on a project. The problem is that I do not want to include test files in the output of git log --patch . The files are in a single directory called mtest ; however, that folder also contains test suite code that I do want to show. Test files, which I want to exclude, have extension mscx or xml , so I would want the filter to work based on that. I have looked at Making 'git log' ignore changes for certain paths but this looks like it excludes commits that modified a file instead of simply excluding the file. Is there a way to do this? I have tried Jubobs answer,

How can I list all modified files by an author between a commit range but only with the last thing that happened to the file in Git?

心不动则不痛 提交于 2019-12-05 12:40:35
The command: git log --oneline --name-status --author=$AUTHOR $COMMIT_RANGE | grep -vE '[a-fA-F0-9]{5} ' | sort | uniq | cat -n Returns a list of the files modified by an author between a range of commits with the status e.g. M for modified. 1 M a_file 2 M another_file 3 M file 4 D file How can I show only the last thing that happened to the file file , e.g. here it was deleted ( D )? I don't want to see the previous modifications to the file (i.e. the M ), only the last thing that happened in that range of commits. Thanks for the attention! You can tweak uniq to look only at a certain field:

How to understand git log --graph

回眸只為那壹抹淺笑 提交于 2019-12-05 10:44:07
问题 I am quite confused with the output of graphic git log. I do understand that each * means a commit, whether it is a diverge, common or merge commit. I do understand that pipes means branch. Let's look at a simple graph log: First of all, which branch does the red pipe (the most left-handed one) represent for? I don't think it is the current branch that I am on, because after I checkout to other branch, the graph looks the same. Furthermore, it doesn't represent master branch neither. Second

How to fix GIT error : HEAD: invalid reflog entry xxxxxxxxxxxxxxxx

假装没事ソ 提交于 2019-12-05 09:18:51
I have met an error before(GIT error: object file is empty) Then I used the method mentioned in how to fix GIT error: object file is empty? After I updated the HEAD pointer to a good object, it does work .but when I restart the machine ,the same error(object file is empty) occured. I tried find . -type f -empty -delete to delete all the empty files and type git fsck --full then the new error occured.(GIT error: HEAD: invalid reflog entry xxxxxxxxxxxxxxxx) Is there anything wrong with my GIT? or just because of my bad operations? And how to fix this problem? The command to use is git reflog