From: Peter Krefting Date: Mon, 10 Aug 2009 04:41:01 GMT Subject: Re: Implementing $Date$ substitution - problem with git status Message-ID: In-Reply-To: <200908092252.58363.j6t@kdbg.org> Johannes Sixt: > The clean filter is applied before 'git diff' generates the diff. Since you > have unstaged changes (I take [...] to mean this), you see a new date on > every invocation. Sorry for being unclear; no, the $Date$ line is the only change that shows up. I removed the surrounding context because I didn't want to publish them. On another machine, there is another file that exhibits the same problem. > After 'git add .htaccess' subsequent 'git diff' should not show any changes. But then I need to check it in again, and I'd like to avoid that, if possible. Is it possible to have a filter run on "commit" instead of "add"? (Or is "commit" just moving changes from the index to the repository, making that impossible?) >> Doing "git reset --hard" or "git checkout master filename" does not >> help, the file is still believed to be modified by git. > > Now, that's an entirely different problem, and I think that there is a > bug. I have observed this as well with my own clean filter sometimes, but > not always. I haven't found a recipe that reliably exhibits the problem. It seems to be triggered by using my date script and doing git add file git commit file git reset --hard file the last command gives me a local copy with the keyword expanded, but marked dirty. Is it possible to have "git add" expand the keyword (both the Git-internal "ident", i.e "$Id$", and my "$Date$")? Would duplicating the "clean" filter as a "smudge" one accomplish that? -- \\// Peter - http://www.softwolves.pp.se/