git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Robin H. Johnson" <robbat2@gentoo.org>,
	"Michał Górny" <mgorny@gentoo.org>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Jeff King" <peff@peff.net>,
	"Lars Schneider" <larsxschneider@gmail.com>
Subject: Re: [RFC PATCH] checkout: Force matching mtime between files
Date: Wed, 25 Apr 2018 10:41:18 +0200	[thread overview]
Message-ID: <871sf3el01.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqtvs18p9o.fsf@gitster-ct.c.googlers.com>


On Mon, Apr 23 2018, Junio C. Hamano wrote:

> "Robin H. Johnson" <robbat2@gentoo.org> writes:
>
>> On Fri, Apr 13, 2018 at 07:01:29PM +0200, Michał Górny wrote:
>>> Currently git does not control mtimes of files being checked out.  This
>>> means that the only assumption you could make is that all files created
>>> or modified within a single checkout action will have mtime between
>>> start time and end time of this checkout.  The relations between mtimes
>>> of different files depend on the order in which they are checked out,
>>> filesystem speed and timestamp precision.
>>> ...
>> Junio: ping for review or inclusion of this patch?
>
> I personally did not think this is a good idea and not worth any
> code contamination with calls to utime().  Is there anybody sane who
> thought this was a good idea in the discussion thread?

I think given that this keeps coming up it would be nice if Git had some
easy facility to do this type of thing, because it's clearly a common
use-case, but I don't think this is the route that should be taken.

By doing it this way we're imposing a fixed cost on checkouts for people
who don't care about this, and this will be mutually exclusive with
other potential approaches.

I think a sane path towards something like this is closer to:

 1. Add ability to have multiple hooks, similar to what I had as a WIP
    in
    https://public-inbox.org/git/CACBZZX6j6q2DUN_Z-Pnent1u714dVNPFBrL_PiEQyLmCzLUVxg@mail.gmail.com/
    and what
    e.g. https://docs.gitlab.com/ee/administration/custom_hooks.html
    implements (partially) in the wild.

 2. Add some config so we can have hook search paths, and ship with a
    default search path for hooks shipped with git.

 3. Then users can trivially enable e.g the
    post-checkout-consistent-mtimes hook, which could either ship with
    git itself, or be its own project.

As it is we've had several threads recently where people have wanted
different mtime solutions, e.g. consistent mtimes within one checkout,
or the mtime of when the file was last changed according to git etc.

I don't think it's a sane approach that the git checkout code learn to
do all of that natively, but I *do* think it's sane that we improve hook
support so we can run whatever custom logic people want at the right
time, which could run around re-setting mtimes.

  parent reply	other threads:[~2018-04-25  8:41 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 17:01 [RFC PATCH] checkout: Force matching mtime between files Michał Górny
2018-04-23 20:07 ` Robin H. Johnson
2018-04-23 23:41   ` Junio C Hamano
2018-04-25  7:13     ` Robin H. Johnson
2018-04-25  8:48       ` Junio C Hamano
2018-04-25 15:18         ` Marc Branchaud
2018-04-25 20:07           ` Robin H. Johnson
2018-04-26  1:25           ` Junio C Hamano
2018-04-26 14:12             ` Marc Branchaud
2018-04-26 14:46             ` Michał Górny
2018-04-28 14:23               ` Duy Nguyen
2018-04-28 19:35                 ` Michał Górny
2018-04-26 16:43           ` Duy Nguyen
2018-04-26 17:48             ` Robin H. Johnson
2018-04-26 18:44               ` Duy Nguyen
2018-04-29 23:56                 ` Junio C Hamano
2018-04-30 15:10                   ` Duy Nguyen
2018-04-27 17:03           ` Duy Nguyen
2018-04-27 21:08             ` Elijah Newren
2018-04-28  6:08               ` Duy Nguyen
2018-04-29 23:47               ` Junio C Hamano
2018-04-27 21:08             ` Marc Branchaud
2018-04-28  6:16               ` Duy Nguyen
2018-04-27 17:18           ` Michał Górny
2018-04-27 19:53             ` Ævar Arnfjörð Bjarmason
2018-04-25  8:41     ` Ævar Arnfjörð Bjarmason [this message]
2018-04-26 17:15       ` Duy Nguyen
2018-04-26 17:51         ` Robin H. Johnson
2018-04-26 17:53         ` SZEDER Gábor
2018-04-26 18:45           ` Duy Nguyen
2018-04-24 14:41 ` Marc Branchaud
2018-04-25  6:58 ` Robin H. Johnson
2018-04-25  7:13   ` Michał Górny
2018-05-05 18:44 ` Jeff King
2018-05-06  3:37   ` Junio C Hamano

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=871sf3el01.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=mgorny@gentoo.org \
    --cc=peff@peff.net \
    --cc=robbat2@gentoo.org \
    /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).