Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

extra output in zsh when define git log output format

Tags:

git

zsh

when I try using

git log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short

in zsh, there's always some extra output like:

27m/Users/tyraeltong/tmp/git-immersion/hello [n]' --graph --date=...* b1ca0c6 2012-01-08 | Added README (HEAD, master) [Tyrael Tong]
* 6844069 2012-01-08 | Added a Rakefile [Tyrael Tong]
* 99430f3 2012-01-08 | Moved hello.rb to lib [Tyrael Tong]
* da616c8 2012-01-08 | Add an author/email info [Tyrael Tong]
* d997079 2012-01-06 | Added a comment (v1) [Tyrael Tong]
* ea557cd 2012-01-06 | Added a default value (v1-beta) [Tyrael Tong]
* 0111ccd 2012-01-06 | First Commit [Tyrael Tong]

How could I remove the 27m/Users/tyraeltong/tmp/git-immersion/hello [n]' --graph --date=...?

like image 875
Tyrael Tong Avatar asked Nov 18 '25 06:11

Tyrael Tong


2 Answers

Inserting "" between % and s solved it for me:

git log --pretty=format:"%h %ad | %""s%d [%an]" --graph --date=short

like image 116
Leventix Avatar answered Nov 20 '25 13:11

Leventix


What you see is discussed in this oh-my-zsh issue. There is also a temporary fix:

All problems are because lib/termsupport.zsh lines 12. for a temporary fix, simply comment this line. this line try to set caption on terminal window. so its not a big deal to remove it :)

In the last comment there is a link to another fix:

You could also fix it like stated in https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/435336/comments/2

(note: it is better that you go to https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/435336/ as “/comments/2” URL displays only the second comment and nothing else)

like image 45
ZyX Avatar answered Nov 20 '25 13:11

ZyX



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!