git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to fix (and find) many git-* --check errors?

From
PLPeter Valdemar Mørch (Lists) <4ux6as402@sneakemail.com>
Date
Aug 9, 2008, 07:28 UTC
Message-ID
<489D473B.3090406@sneakemail.com>
In-Reply-To
<7viqubcnop.fsf@gitster.siamese.dyndns.org>
Junio C Hamano gitster-at-pobox.com |Lists| wrote:
Show 10 quoted lines
> Starting from a clean checkout, you could do something like this:
> 
> 	$ git reset --hard
>         $ rm .git/index
>         $ git diff --binary -R HEAD >P.diff
>         $ git apply --whitespace=fix --cached <P.diff
> 	$ git commit -m "Fixed all whitespace gotchas"
> 
> P.diff contains essentially everything, and you are recreating everything
> from that patch.

Thanks for taking the time to answer my many mails and questions. It really is helpful to me.

Rambling on:

Scary with the "rm .git/index"! It bascially creates an empty index it seems... That was news to me. As a newbie I try not to meddle too much in .git/ ...

I tried the above on git.git, and it gave: warning: 485 lines applied after fixing whitespace errors.

I would suggest finishing the above with: $ git checkout HEAD otherwise, the working dir is stuck at the old unfixed state.

But like I posted earlier, I have another solution that works on selected files. With git, there is always more than one way to do things, it seems...

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com
Previous: Junio C Hamano
Message 6 of 6 in “How to fix (and find) many git-* --check errors?”
  1. Peter Valdemar Mørch (Lists)Aug 8, 2008
  2. Jeff KingAug 8, 2008
  3. Björn SteinbrinkAug 8, 2008
  4. Peter Valdemar Mørch (Lists)Aug 8, 2008
  5. Junio C HamanoAug 8, 2008
  6. Peter Valdemar Mørch (Lists)Aug 9, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.