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

Re: Forcing rewrite of files in working tree

From
RDRogan Dawes <lists@dawes.za.net>
Date
Aug 3, 2007, 12:58 UTC
Message-ID
<46B3268C.7060707@dawes.za.net>
In-Reply-To
<200708031345.47127.andyparkins@gmail.com>
Andy Parkins wrote:
Show 20 quoted lines
> Hello,
> 
> I want to write a little recipe in a Makefile that ensures the $Id$ field in a 
> series of text files is correct.  In case it's relevant, I'm including a load 
> of asciidoc files as subsections into one master file; each file has a $Id$ 
> field in the header, which very nicely prints out at the start of each 
> section.  However, the $Id$ field is only written on checkout (not on checkin 
> for fairly obvious reasons).  That means that for any files I've changed, the 
> $Id$ is wrong.  Before I generate output using ASCIIdoc I'd like to ensure 
> the $Id$ is correct.
> 
> How do I do it?
> 
> The only method I've found is to delete the file in the work tree then do 
> git-checkout again.  Even with -f, if the file is not changed git doesn't 
> perform a checkout again, so git-checkout -f is not sufficient.  I assume I 
> can do what I want with some clever plumbing, but I don't know any 
> plumbing. :-)
> 
> Andy
$ git reset --hard
?
Rogan
Previous: Andy ParkinsNext: Andy Parkins
Message 2 of 4 in “Forcing rewrite of files in working tree”
  1. Andy ParkinsAug 3, 2007
  2. Rogan DawesAug 3, 2007
  3. Andy ParkinsAug 3, 2007
  4. Linus TorvaldsAug 3, 2007

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.