All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Lear <rael@zopyra.com>
To: git@vger.kernel.org
Subject: How to effectively undo a part of a commit
Date: Thu, 1 Mar 2007 10:33:12 -0600	[thread overview]
Message-ID: <17895.72.525085.734138@lisa.zopyra.com> (raw)

A colleague made a change to a file and committed it.  Then, he
made another change to the file and somehow undid the previous work,
then he committed the file.  Now, he would like to get the first change
he made and reapply it.

So, the changes look like this:

F1 -> delta 1 -> F2
F2 -> delta 2 -> F3

So, starting with F, he applies delta 1 to get F2.
Then, he applies delta 2 to get F3.

He says that using cvs he would do something like this:

% cvs update -j F1 -j F2

To apply delta 1 to F3.

We tried using git to get the delta 1 as a patch --- that went fine.
Then we used git-apply to apply the patch, but it refused, and it was
obvious that the line numbers of the patch no longer corresponded to
the line numbers in the file in his working tree.

Is there a way in git to do this, or is this an inherently unworkable
problem, as for some reason, I suspect?


Bill

             reply	other threads:[~2007-03-01 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 16:33 Bill Lear [this message]
2007-03-01 16:51 ` How to effectively undo a part of a commit Simon 'corecode' Schubert

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=17895.72.525085.734138@lisa.zopyra.com \
    --to=rael@zopyra.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 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.