git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stephen Kelly <steveire@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git interactive rebase 'consume' command
Date: Sun, 20 Jan 2013 12:23:41 -0800	[thread overview]
Message-ID: <7v8v7nli2a.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <kdhfk6$von$1@ger.gmane.org> (Stephen Kelly's message of "Sun, 20 Jan 2013 20:13:12 +0100")

Stephen Kelly <steveire@gmail.com> writes:

> Junio C Hamano wrote:
>> Sorry, but I do not understand what you are trying to solve.
>> 
>> How can 1313a5e, which fixes misakes made in c2f62a3, come before
>> that commit in the first place?
>
> One scenario is something like this:
>
>  Start with a clean HEAD (always a good idea :) )
>  hack hack hack
>  make multiple commits
>  realize that a hunk you committed in an early patch belongs in a later one.
>  use git rebase -i to fix it.
>
> Is that more clear?

Not really.

If you think that the author timestamp is the time the author
finished working on the commit, shouldn't the squashed result get
the timestamp when you finished squashing, not the timestamp of
either of the commits that were squashed?  Unlike "fixup" and
"reword", the change you are making is very different from any of
the original constituent commmits, and you finished working on that
change when you squashed these commits into one.  Propagating the
timestamp from the later ones sounds equally wrong for that purpose.

In any case, the intent of the author timestamp is to record the
time the author _started_ working on the change and came up with an
initial, possibly a partial, draft.  It does not record the time
when the commit was finalized.  "git commit --amend" preserves the
original timestamp, doesn't it?

In your example:

>  pick 07bc3c9 Good commit.
>  pick 1313a5e Commit to fixup into c2f62a3.
>  pick c2f62a3 Another commit.

you can view 1313a5e as a "preparatory clean-up for the real change
in c2f62a3", which could be a separate commit in the final history.
If you choose to squash them together into one, the time you
recorded 1313a5e was when you started working on the combined
change, so it does not sound so wrong to take that author timestamp
for the result.

  reply	other threads:[~2013-01-20 20:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 14:05 git interactive rebase 'consume' command Stephen Kelly
2013-01-20 14:17 ` John Keeping
2013-01-20 14:23   ` Stephen Kelly
2013-01-20 19:05 ` Junio C Hamano
2013-01-20 19:13   ` Stephen Kelly
2013-01-20 20:23     ` Junio C Hamano [this message]
2013-01-21  1:49       ` Jeff King
2013-01-21  8:40       ` Stephen Kelly
2013-01-21 11:05 ` Michael Haggerty
2013-01-21 19:05   ` Stephen Kelly

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=7v8v7nli2a.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=steveire@gmail.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.
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).