3

When searching for a regular string in Git commits, you can use this command:

git log -S'string'

But searching for a tab character doesn't work:

git log -S'\t'

I've also tried using --pickaxe-regex and --perl-regexp with variations of tab representations with no luck.

How do you express a tab character so it can be found?

jub0bs
  • 60,866
  • 25
  • 183
  • 186
Neil
  • 24,551
  • 15
  • 60
  • 81
  • 1
    Have you tried actually typing a tab? If you're on a Unix shell and it triggers command completion, type control-V then tab. – alexis Apr 08 '15 at 22:55
  • Related: http://stackoverflow.com/q/4262150/2541573 – jub0bs Apr 08 '15 at 23:42
  • I tried pasting a tab from the clipboard, but this doesn't work of course. Typing a tab the way you mentioned worked. – Neil Apr 09 '15 at 17:24

1 Answers1

2

If you are using bash you can do

git log -S"$(echo -e '\t')"

or type a tab by pressing CTRL+V, then TAB.

zvyn
  • 706
  • 8
  • 17
  • 1
    You can replace `"$(echo -e '\t')"` with `"$'\t'"`, it's a bit shorter (i am, however, not sure how portable it is). – Frax Apr 08 '15 at 23:18