git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Richard Hartmann <richih.mailinglist@gmail.com>
Cc: Chris Webb <chris@arachsys.com>, Thorsten Glaser <tg@mirbsd.de>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	Git List <git@vger.kernel.org>
Subject: Re: Tracking file metadata in git -- fix metastore or enhance git?
Date: Sat, 9 Apr 2011 19:15:18 -0500	[thread overview]
Message-ID: <20110410001518.GA6380@elie> (raw)
In-Reply-To: <BANLkTim5DPjGjJ=SfnNfXpzCd6=PKnSs6g@mail.gmail.com>

Hi again.

Chris Webb wrote:

> (Disclaimer: I've never tried using smudge filters; maybe they can't be used
> in the way I describe!)

In the current form, they couldn't.  smudge/clean filters take their
input through stdin and write their output to stdout --- there is not
a chance to look at the on-disk directory entry to get metadata.

It might be possible to introduce a new %p substitution pointing to
the actual file the filter is working on, since with a few exceptions,
the file passed to a clean filter is already on-disk.  Exceptions:

 * "git blame --contents=- -- <path>" reads from stdin instead of <path>.

 * the low-level --renormalize facility (see git-merge(1)) and its
   callers feed a clean filter with output from a smudge filter before
   content hits the disk.

 * "git hash-object --path=<path> --stdin" reads from stdin instead of
   <path>.

I'd be worried about using a clean filter to store timestamps.
Treating a file as changed whenever mtime changes could be confusing.
Treating atime changes as content changes would be even stranger.

Richard Hartmann wrote:

> One large question in my mind is if anyone who's familiar enough with
> the codebase and has the time would be interested in actually
> implementing this.

I don't think this has to touch git core, except perhaps as mentioned
above.  Please feel free to cc me if working on hooks (pre-commit hook
or clean filter) to automatically track metadata and some mechanism to
restore it.  I'd be glad to give feedback and help in any other way I
can.

To be clear, I will not be driving this forward --- it's just not
something I've ever needed, so I'd trust others to do a better job of
taking good care of the actual use cases.

Ciao,
Jonathan

  reply	other threads:[~2011-04-10  0:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 19:16 Tracking file metadata in git -- fix metastore or enhance git? Richard Hartmann
2011-04-07 19:27 ` Thorsten Glaser
2011-04-08  0:29   ` Richard Hartmann
2011-04-08 10:01     ` Michael J Gruber
2011-04-08 18:59       ` Jonathan Nieder
2011-04-08 19:05         ` Thorsten Glaser
2011-04-08 19:45           ` Jonathan Nieder
2011-04-08 19:58             ` Thorsten Glaser
2011-04-08 21:23               ` Richard Hartmann
2011-04-09  8:11                 ` Chris Webb
2011-04-09  9:09                   ` Richard Hartmann
2011-04-10  0:15                     ` Jonathan Nieder [this message]
2011-04-10  1:03                       ` Junio C Hamano
2011-04-10  1:31                         ` Richard Hartmann
2011-04-11  0:12                           ` Richard Hartmann
2011-04-18  0:21 ` Richard Hartmann
2011-04-18  0:45   ` Jonathan Nieder
2011-12-14  4:54     ` johnnyutahh
2011-12-20  0:55       ` Richard Hartmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110410001518.GA6380@elie \
    --to=jrnieder@gmail.com \
    --cc=chris@arachsys.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=richih.mailinglist@gmail.com \
    --cc=tg@mirbsd.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).