On 20/02/18 22:48, Peter Backes wrote:
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 (`<mtime><TAB><path><LF>`)
I'm stuck there because of <path> 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.
In recent versions of git there's unquote_path() in Git.pm, you could
possibly use that with perl -e from your script
Best Wishes
Phillip
Best wishes
Peter