All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Witten <mfwitten@gmail.com>
To: Hilco Wijbenga <hilco.wijbenga@gmail.com>
Cc: Kyle Moffett <kyle@moffetthome.net>,
	Junio C Hamano <gitster@pobox.com>,
	Evan Shelhamer <shelhamer@imaginarynumber.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Branches & directories
Date: Tue, 23 Aug 2011 14:46:04 +0000	[thread overview]
Message-ID: <CAMOZ1BvM08FTODUbGhQMqAmVLWY1cQjTcDknGFp3ZGTsH=0fZw@mail.gmail.com> (raw)
In-Reply-To: <CAE1pOi1axNmGaPVXqBH02x0N=Z6tgO9R00RTokuJm50eY-OoNg@mail.gmail.com>

On Mon, Aug 22, 2011 at 20:10, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:
> On 22 August 2011 12:31, Kyle Moffett <kyle@moffetthome.net> wrote:
>> On Mon, Aug 22, 2011 at 14:49, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:
>>> On 22 August 2011 05:46, Kyle Moffett <kyle@moffetthome.net> wrote:
>>>> On Mon, Aug 22, 2011 at 01:36, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:
>>>>> On 21 August 2011 20:01, Kyle Moffett <kyle@moffetthome.net> wrote:
>>>> In particular, even "git stash" intentionally does not preserve file times,
>>>> so you would end up rebuilding everything anyways because all of your
>>>> source files would be as new as your object files.
>>>
>>> Yes, I just noticed that. Why do you say "intentionally"? Is extra
>>> work being done to make it so? If yes, then shouldn't that be
>>> configurable?
>>
>> Well, there's 2 reasons:
>>
>> (1) The GIT data-structures simply have no place for file timestamps, and
>> "git stash" is simply a special way of dumping files into a temporary commit.
>
> That's what I thought. The "intentionally" threw me off. It's not
> intentional, it's just a side effect.

No, it's intentional.

This discussion about timestamps is not new; the mailing list is
littered with people wondering about it. The data structures are the
way they are for intentional reasons, as suggested by Kyle's example.

>> (2) You almost always *don't* want to preserve timestamps.  For example:
>>
>> $ git checkout -b my-feature origin/master
>> $ vim some-file.c
>> $ make
>> $ git add some-file.c && git commit -m "A new feature"
>> $ git checkout -b my-bugfix origin/master
>> $ vim other-file.c
>> $ make
>>
>> If GIT preserved timestamps, the second "make" would fail to rebuild the
>> product "some-file.o" because "some-file.c" is still older than it, even
>> though "some-file.c" has changed since the last build!!!
>>
>> Really, GIT is only intended for storing source code.  If you want to store
>> other kinds of things (like timestamps, permissions, etc), then you need to
>> turn them into source code (IE: a text file and a "make install" target) and
>> then store them that way.
>
> Yep, that all makes sense. I just wish there was at least an option to
> keep the timestamp (and possibly other such things). Even Subversion
> can do that... ;-) After all, not everybody uses C & make.

Yes, well, the crux there is `(and possibly other such things)'. That
is an open-ended specification because nobody can agree on what such
things should include.

One of git's major design goals has been efficiency, so it's natural
that git only handles what is necessary for its prime purpose of
managing a history of line-oriented textual content.

However, other tools have been built on top of git's infrastructure in
order to store all manner of metadata (usually for the purposes of
backing up files with all of their special metadata).

Essentially, only *you* know what `other such things' *you* need, so
it's up to you to design a way of storing such information and
retrieving it yourself. After all, not everybody (indeed, nearly
nobody, I'd wager) has your specific difficulties.

  parent reply	other threads:[~2011-08-23 14:46 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 18:35 Branches & directories Hilco Wijbenga
2011-08-17 18:47 ` Evan Shelhamer
2011-08-17 19:14   ` Junio C Hamano
2011-08-17 21:23     ` Hilco Wijbenga
2011-08-18  4:45       ` Jonathan Nieder
2011-08-21 19:48         ` Hilco Wijbenga
2011-08-18  5:52       ` Michael Witten
2011-08-18 10:56         ` Michael J Gruber
2011-08-18 17:49           ` Michael Witten
2011-08-19  0:13         ` Jonathan Nieder
2011-08-21 20:25         ` Hilco Wijbenga
2011-08-21 20:53           ` Michael Witten
2011-08-21 21:37             ` Hilco Wijbenga
2011-08-21 23:06               ` Michael Witten
2011-08-21 23:35                 ` Hilco Wijbenga
2011-08-22  0:07                   ` Michael Witten
2011-08-22  0:47                     ` Hilco Wijbenga
2011-08-22  1:53                       ` Hilco Wijbenga
2011-08-22  2:05                       ` Michael Witten
2011-08-22  2:13                         ` Hilco Wijbenga
2011-08-22  3:01                           ` Kyle Moffett
2011-08-22  5:36                             ` Hilco Wijbenga
2011-08-22 12:46                               ` Kyle Moffett
2011-08-22 18:49                                 ` Hilco Wijbenga
2011-08-22 19:31                                   ` Kyle Moffett
2011-08-22 20:10                                     ` Hilco Wijbenga
2011-08-22 21:01                                       ` Restoring timestamps (Re: Branches & directories) Jonathan Nieder
2011-08-22 22:33                                         ` Hilco Wijbenga
2011-08-22 23:21                                           ` Jonathan Nieder
2011-08-23  3:06                                             ` Hilco Wijbenga
2011-08-23  3:20                                               ` Hilco Wijbenga
2011-10-02 15:06                                               ` Enrico Weigelt
2011-10-02 22:29                                                 ` Hilco Wijbenga
     [not found]                                               ` <CA+sFfMf=gi5CWyfZEt-Nmdr4J9g__maQTqy1WePr1x8D-AVr4A@mail.gmail.com>
2011-10-02 22:25                                                 ` Hilco Wijbenga
2011-08-23 14:46                                       ` Michael Witten [this message]
2011-10-02 16:57                                       ` Branches & directories Robin Rosenberg
2011-10-02 17:31                                         ` Ronan Keryell
2011-10-02 19:09                                           ` Matthieu Moy
2011-10-02 23:45                                             ` Hilco Wijbenga
2011-10-02 23:40                                         ` Hilco Wijbenga
2011-10-03  3:07                                           ` Jeff King
2011-10-03  7:15                                             ` Hilco Wijbenga
2011-10-03  7:30                                               ` Jeff King
2011-10-03  7:32                                               ` Matthieu Moy
2011-10-03  7:34                                                 ` Jeff King
2011-10-03  7:41                                                   ` Matthieu Moy
2011-10-03  7:44                                                     ` Jeff King
2011-10-03  7:48                                                       ` Junio C Hamano
2011-10-03  7:51                                                         ` Jeff King
2011-10-03 17:31                                                 ` Hilco Wijbenga
2011-10-03 14:59                                               ` Robin Rosenberg
2011-10-03 17:20                                                 ` Hilco Wijbenga

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='CAMOZ1BvM08FTODUbGhQMqAmVLWY1cQjTcDknGFp3ZGTsH=0fZw@mail.gmail.com' \
    --to=mfwitten@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hilco.wijbenga@gmail.com \
    --cc=kyle@moffetthome.net \
    --cc=shelhamer@imaginarynumber.net \
    /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.