All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Derek Fawcus <dfawcus+lists-git@employees.org>
Cc: Peter Backes <rtc@helen.PLASMA.Xg8.DE>, git@vger.kernel.org
Subject: Re: Git should preserve modification times at least on request
Date: Wed, 21 Feb 2018 22:33:05 +0100	[thread overview]
Message-ID: <87bmgif2pa.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <20180221210339.GA43094@accordion.employees.org>


On Wed, Feb 21 2018, Derek Fawcus jotted:

> On Mon, Feb 19, 2018 at 10:22:36PM +0100, Peter Backes wrote:
>>
>> It is pretty annoying that git cannot, even if I know what I am doing,
>> and explicitly want it to, preserve the modification time.
>
> The use case I've come across where it would be of value is for code
> archeology, either importing a bunch of tar files, or importing a
> repo from some other VCS.
>
> There preserving the mod times can be useful when one is subsequently
> figuring out what changed, and the scope of the 'commits' is too big
> (i.e. the granularity of the tar files themselves).
>
> e.g. initial commits are done on tar boundaries, but one may try to
> figure out individual changes from a ChangeLog file.  I've done this
> a couple of times, but to date it has required keeping the untarred
> trees around (or a timestamp list file from each tree), in addition
> to the git repro in to which one is then synthesizing smaller commits.

This sounds like a sensible job for a git import tool, i.e. import a
target directory into git, and instead of 'git add'-ing the whole thing
it would look at the mtimes, sort files by mtime, then add them in order
and only commit those files that had the same mtime in the same commit
(or within some boundary).

The advantage of doing this via such a tool is that you could tweak it
to commit by any criteria you wanted, e.g. not mtime but ctime or even
atime.

You'd get the same thing as you'd get if git's tree format would change
to include mtimes (which isn't going to happen), but with a lot more
flexibility.

  reply	other threads:[~2018-02-21 21:33 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 21:22 Git should preserve modification times at least on request Peter Backes
2018-02-19 21:58 ` Johannes Schindelin
2018-02-19 22:08   ` Peter Backes
2018-02-20  1:22     ` Theodore Ts'o
2018-02-20 10:46     ` Johannes Schindelin
2018-02-20 11:53       ` Peter Backes
2018-02-20 21:05       ` Peter Backes
2018-02-20 22:32         ` Johannes Schindelin
2018-02-20 22:48           ` Peter Backes
2018-02-21 21:30             ` Phillip Wood
2018-02-19 22:37   ` Randall S. Becker
2018-02-19 23:22     ` Hilco Wijbenga
2018-02-20 16:42       ` Hilco Wijbenga
2018-02-20 21:16 ` Jeff King
2018-02-20 22:05   ` Peter Backes
2018-02-21  9:48     ` Jacob Keller
2018-02-20 23:40   ` Junio C Hamano
2018-02-21 21:03 ` Derek Fawcus
2018-02-21 21:33   ` Ævar Arnfjörð Bjarmason [this message]
2018-02-21 22:14     ` Peter Backes
2018-02-21 22:44       ` Ævar Arnfjörð Bjarmason
2018-02-21 23:12         ` Peter Backes
2018-02-21 23:58           ` Randall S. Becker
2018-02-22  2:05             ` 'Peter Backes'
2018-02-26 10:56               ` Andreas Krey
2018-02-26 11:04                 ` 'Peter Backes'
2018-02-22 23:24         ` Derek Fawcus
2018-02-23 12:28       ` Konstantin Khomoutov

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

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

  git send-email \
    --in-reply-to=87bmgif2pa.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=dfawcus+lists-git@employees.org \
    --cc=git@vger.kernel.org \
    --cc=rtc@helen.PLASMA.Xg8.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.