crystalright.blogg.se

Git log author
Git log author






git log author

$ git log -pretty="format:%at commit %C(yellow)%H%Creset\nAuthor: %an \nDate: %aD\n\n %s\n" | sort -r | cut -d" " -f2- | sed -e "s/\ The convenient part of this is that the pretty flag supports some default colors, so it was as simple as adding %C(yellow) and %Creset. \\`echo -e '\n\r'`/g" | tr -d '\15\32' | less Version 4.0: Add Colorįinally, to complete the script, I had to add color. $ git log -pretty="format:%at commit %H\nAuthor: %an \nDate: %aD\n\n %s\n" | sort -r | cut -d" " -f2- | sed -e "s/\ After many failed attempts and much time spent scouring the internet, once again, I found a genius solution by Indiana University: tr -d '\15\32'. Now, less is showing a silly carriage return character in the output. The 2.0 solution works great! But, we have a minor issue. Fortunately, on that same thread, I saw an interesting solution: use echo. I figured there HAD to be a way to add a silly line return. The only problem with the 1.0 solution is that it requires the line break be inserted, thus it is a two-line command. g' Version 2.0: Use Echo for New Line Character $ while read line do git log -1 $line echo "" done \nDate: %aD\n\n %s\n" | sort -r | cut -d" " -f2- | sed -e 's/ The result works, but it dumps everything to standard output which you can't pipe to less unless you make it into a script, which is fine, but not simple enough.

git log author

I was playing around with the idea of writing a for loop to loop through the sorted hashes and run a git log when I came accross the above thread. $ git log -pretty="format:%at %H" | sort | sed 's/.* //' | git log -stdin Solution 2: While Loop Git still lists them in order of Commit Date, so I'm not sure what this guy was talking about. (Scroll to the bottom for my final solution.) Solution 1: Git Log -stdin Flag However, after scouring the internet I found a number of solutions that worked and didn't work. Long story short, there is no way to do this in Git. There are times when you want to order the git log by the Author Date instead of the Commit Date.

git log author

By default, Git orders the git log by the Commit Date, but shows the Author Date in the commit's message. As Alex Peattie explains, the Commit Date is date time when the commit was added to the current branch and Author Date is when the author actually wrote the first commit message. Git commits have both a Commit Date and an Author Date.








Git log author