From: Junio C Hamano <gitster@pobox.com>
To: Patrick Doyle <wpdster@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: OK, how should I have done this...
Date: Mon, 22 Nov 2010 16:05:06 -0800 [thread overview]
Message-ID: <7vr5ecvr9p.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTim0_J0i_a0o+z1oCC4mramfUxCGtCg_Y+ab+h+-@mail.gmail.com> (Patrick Doyle's message of "Mon\, 22 Nov 2010 08\:22\:09 -0500")
Patrick Doyle <wpdster@gmail.com> writes:
> But I _know_ that there must be a better way to do this. What should
> I have done?
Depends on how you wanted to fix your history (we already know from your
description what shape of tree you want to end up in).
If you want to pretend that you were perfect and never made mistakes in
these three files you had to fix later, then history surgery like what
Matthieu suggested would be necessary (I won't repeat how).
On the other hand, if you want to record what you did in the time order,
then I would probably do this:
$ git checkout master ; test ;# broken
$ git checkout 5ccce3 ; test ;# ok
$ git checkout master -- file1 ; test ;# ok
$ git checkout master -- file2 ; test ;# ok
$ git checkout master -- blah/file7 ; test ;# broken
$ edit blah/file7 ; test ;# ok
$ git reset --soft master
$ git commit -a -m 'The change to file3 was borked on the other env' -e
and in this particular case, this would be what I would have done, as a
separate "fix-up" commit will give me a place to describe why a solution
different from the initial attempt, which was Ok on the original machine,
was necessary.
next prev parent reply other threads:[~2010-11-23 0:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 13:22 OK, how should I have done this Patrick Doyle
2010-11-22 13:34 ` Matthieu Moy
2010-11-22 14:22 ` Patrick Doyle
2010-11-22 14:29 ` Tay Ray Chuan
2010-11-22 16:14 ` Matthieu Moy
2010-11-23 0:05 ` Junio C Hamano [this message]
2010-11-23 0:17 ` Patrick Doyle
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=7vr5ecvr9p.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=wpdster@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).