From: Junio C Hamano <gitster@pobox.com>
To: Rod <armyofthepenguin@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: A git problem with timestamps
Date: Sun, 07 Sep 2008 13:03:26 -0700 [thread overview]
Message-ID: <7vvdx7lo4x.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <200809070954.03394.armyofthepenguin@gmail.com> (armyofthepenguin@gmail.com's message of "Sun, 7 Sep 2008 09:54:02 -0400")
Rod <armyofthepenguin@gmail.com> writes:
> Here are the git commands Fred is attempting to use:
> # Branch the *base* of master
> git checkout -b updated_original_source_code 345678
>
> cp ../updated_source_code.tar.gz .
> tar zxvf updated_source_code.tar.gz
>
> # Commit all changes from original_source_code
> # to updated_source_code
> git -a -m "Updated original source code"
>
> # Now apply the history of master onto this branch:
> # This is where they get hosed because the timestamps
> # from Barney's commits are wrong, and hence the
> # generated patches are out of order.
> git format-patch 345678..master | git am -k -3
First of all, the branch name "updated_original_source_code" does not make
much sense. When you get another round of source tarball update, what
would you do? Create "updated_original_source_code_2"? The one after
that is "updated_original_source_code_3"?
That misses the whole point of revision control, doesn't it?
You instead keep an "upstream" branch, whose tip might be at 345678 before
accepting the tarball update, and you advance its tip only with the
upstream updates:
Barney o---o---o o---o
/ \ / \
Fred o---o---o---o---o---o---o---o---o---o
/
---o---------------------------------------o
^ ^
upstream ===== (tarball update) ======> upstream
You can tag its tip after every time you accept the tarball update from
your upstream.
A natural thing to do from there is to _merge_ upstream changes to your
shared development, that results in:
Barney o---o---o o---o
/ \ / \
Fred o---o---o---o---o---o---o---o---o---o---*
/ /
---o---------------------------------------o
^ ^
upstream ===== (tarball update) ======> upstream
Of course you could rebase all history on top of updated upstream (buy why
bother? -- you are not keeping a linear history by cross merging between
two developers already, so there is no point doing a "format-patch | am"
sequence to linearlize your history at this point), and --topo-order given
to format-patch may help with broken timestamps one of you recorded.
prev parent reply other threads:[~2008-09-07 20:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-07 13:54 A git problem with timestamps Rod
2008-09-07 20:03 ` Junio C Hamano [this message]
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=7vvdx7lo4x.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=armyofthepenguin@gmail.com \
--cc=git@vger.kernel.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.
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 NNTP newsgroup(s).