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: Hector Santos <winserver.support@winserver.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Git "Keeping Original Dates"
Date: Tue, 6 Jun 2017 00:06:18 +0200	[thread overview]
Message-ID: <CACBZZX7VpmEjbzwGd+S15xVLRrkYRxqcf0LUKF1B7pAsd7Lr4w@mail.gmail.com> (raw)
In-Reply-To: <1C2B896999CB4549BCAC61EB369E932E@blackfat>

On Mon, Jun 5, 2017 at 11:25 PM, Jason Pyeron <jpyeron@pdinc.us> wrote:
>> -----Original Message-----
>> From: Hector Santos
>> Sent: Monday, June 5, 2017 5:14 PM
>>
>> I'm implementing GIT.  If there an option or compile/version that "keep"
> file timestamps?
>
> That is not in the tree data structure, see below.
>
> root@blackfat /projects/tipsoftheday
> $ git cat-file -p head
> tree 4ca3c2a853c8e817d7de8563c331899cace8ee85
> parent 2a33f293df6df0d3978612e41fb1ecd52e2450a5
> author Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
> committer Jason Pyeron <jpyeron@pdinc.us> 1496424815 -0400
>
> add JDK to CM
>
> root@blackfat /projects/tipsoftheday
> $ git cat-file -p 4ca3c2a853c8e817d7de8563c331899cace8ee85
> 040000 tree 76094b81b3877b5b27cd4fe518fa0708af3cefed    admin
> 040000 tree c66a88871c285e1485f92be0f8fa47185d94d0b3    client
> 040000 tree 460495af209a580e65b5d0b38132d774ddb283b7    database
> 040000 tree 264b191b036180039f3fd8c5d56c2b6800cb2ca2    doc
> 040000 tree dd128195971f7bafa56371aa6027d7c6bc80f351    middleware
> 040000 tree 7861fd39923950d501d4e39aeac4762f7daaca6b    reports
> 040000 tree 2ad3dedf0313ae775321c88c53741a4b4a7e87b0    tools
>
> I wish it was an allowable extension, the date could be between the mode and
> object type.

Yes it's not part of the tree structure, but in this case you can
simply set/update the mtime to the date of the last commit that
modified the file.

It can be a bit expensive to bootstrap that, and git doesn't help you
along at all, you need to do it via hooks or some script you run, but
that's a neat way to shove it into the datamodel if you need this for
some reason.

  reply	other threads:[~2017-06-05 22:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 21:14 Git "Keeping Original Dates" Hector Santos
2017-06-05 21:25 ` Jason Pyeron
2017-06-05 22:06   ` Ævar Arnfjörð Bjarmason [this message]
2017-06-05 23:36     ` Hector Santos
2017-06-06 16:09       ` Theodore Ts'o
2017-06-05 21:27 ` Ævar Arnfjörð Bjarmason
2017-06-06  1:22   ` Jeff King
2017-06-06  2:43     ` Hector Santos
2017-06-06  7:12 ` 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

  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=CACBZZX7VpmEjbzwGd+S15xVLRrkYRxqcf0LUKF1B7pAsd7Lr4w@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=winserver.support@winserver.com \
    /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).