From: Peter Backes Date: Tue, 20 Feb 2018 22:48:09 GMT Subject: Re: Git should preserve modification times at least on request Message-ID: <20180220224808.GA25678@helen.PLASMA.Xg8.DE> In-Reply-To: On Tue, Feb 20, 2018 at 11:32:23PM +0100, Johannes Schindelin wrote: > Hi Peter, > > On Tue, 20 Feb 2018, Peter Backes wrote: > > > On Tue, Feb 20, 2018 at 11:46:38AM +0100, Johannes Schindelin wrote: > > > > > I would probably invent a file format (``) > > > > I'm stuck there because of being munged. > > From which command do you want to get it? If you are looking at `git > diff`, you may want to use the `-z --name-only` options to avoid munging > the paths. I plan to use "git diff-tree --name-only $w_tree HEAD" and subtract all lines from "git diff-index --name-only HEAD" to get the files for which the timestamp should be stored.. If I use "-z" I get the non-munged path, but I cannot safely store such paths in the proposed file format; they might contain newlines (sigh). So at one point I have to munge. Then the same question arises when I have to get the actual path from the munged path when restoring the timestamps. If there's no ready-made functionality to munge and unmunge paths, I have to write some awk for this. At first I thought this might add one more dependency to git, but it seems that awk is already used in git-mergetool.sh, so I suppose it's okay to use in git-stash.sh etc, too. Best wishes Peter -- Peter Backes, rtc@helen.PLASMA.Xg8.DE