0

During a rebase of some git branch of mine, I get a warning saying:

/path/to/repo/.git/rebase-apply/patch:21: trailing whitespace.
some text in a file here

Now, I can go grepping for that string, but - is there a way to make git tell me in which file (and maybe at which line number) it found the offending trailing whitespace?

einpoklum
  • 118,144
  • 57
  • 340
  • 684
  • The whitespace errors come from the patch (What you're trying to rebase on top of). You probably still have the patch in your repo (`/path/to/repo/.git/rebase-apply/patch`) that you can look at to know which file it was. Do you also want to ensure that you're not committing trailing whitespace? – zrrbite Oct 13 '20 at 07:44
  • "Do you also want to ensure that you're not committing trailing whitespace?" <- Maybe... if I say yes, would this help me? – einpoklum Oct 13 '20 at 07:53
  • Not for your original question, no. But I wasn't sure if you thought you were the offender or not. – zrrbite Oct 13 '20 at 07:57
  • @zrrbite: I am :-( – einpoklum Oct 13 '20 at 08:11
  • For now you can probably check the patch file. But It would probably be a good idea to push a strategy in your team to remove trailing whitespaces upon commit. I've seen a number of posts in here on that topic. – zrrbite Oct 13 '20 at 08:18

0 Answers0