git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
To: Junio C Hamano <gitster@pobox.com>
Cc: Neal Kreitzinger <nkreitzinger@gmail.com>, git@vger.kernel.org
Subject: Re: How to commit incomplete changes?
Date: Fri, 16 Dec 2011 13:15:28 +0100	[thread overview]
Message-ID: <hbf.20111216xubv@bombur.uio.no> (raw)
In-Reply-To: <7v8vmdl62s.fsf@alter.siamese.dyndns.org>

[Neal Kreitzinger]
> I assume by 'generated changes' you mean the automerge in git...

No.  And to your questions of why I want this with unpublished work:
No.  Like I wrote, I'm talking about published commits.

[Junio C Hamano]
> My reading of the "need to split" example was not "bulk of work plus fixes
> to mistakes".  Imagine you are working on somebody else's code and for some
> reason you want to do
> 
> 	s/setenv/xsetenv/g
> 
> all over the code, and also add a wrapper to implement xsetenv() function.

Yes - except there is no "mistakes" since it's deliberate.  I'd do
s/setenv/xsetenv/g, which does too little (misses some preprocessor
stuff) or is too greedy, then commit anyway and clean up in next commit.

I could make and commit a much more complicated script to do it all, but
that's unhelpful when trying to read what the heck the change is doing.
And who knows what it'd do when run on a somewhat different codebase.

That example matches a future internal API change.  My current issue
is changes generated with 'autoreconf' - after cleaning up an utter
libtool/automake mess by hand, which will break things if I don't
autoreconf in the same commmit.

> You _could_ do it in one single commit, but what happens when you try to
> adjust to the updated upstream code, which may have added new callsites to
> setenv()?

Indeed.  In this case, it'd be when cherry-picking from the devel branch
to the release branch.  These still differ too much, a legacy of our old
CVS workflow.

> If you keep it as two patches, one is mechanical (i.e. s/setenv/xsetenv/g)
> and the other is manual (i.e. implementation of xsetenv()), then you can
> discard the text of the "mechanical" one from the old series and instead
> run the substitution on the updated code, and then cherry-pick the
> "manual" one.

Yes.  I'd order it in a sequence which never broke anything if I could.

Well, come to think of it: Possibly I could introduce some new code
which would only exist for the sake of patching over the temporary
breakage, and then delete that code again 2-3 commits later.  In this
case, I'd among other things create an obsolete libtool.m4 which is
currently hiding inside aclocal.m4.  Not sure if that makes more sense
than just having a few broken commits.

-- 
Hallvard

  reply	other threads:[~2011-12-16 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-14 23:24 How to commit incomplete changes? Hallvard B Furuseth
2011-12-15  6:44 ` Alexey Shumkin
2011-12-15  7:11   ` Hallvard B Furuseth
2011-12-15  8:22     ` Alexey Shumkin
2011-12-15  8:39       ` Alexey Shumkin
2011-12-15 22:51 ` Neal Kreitzinger
2011-12-16  0:21   ` Junio C Hamano
2011-12-16 12:15     ` Hallvard Breien Furuseth [this message]
2011-12-16 12:58       ` Hallvard Breien Furuseth
2011-12-16  1:49 ` Tomas Carnecky

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=hbf.20111216xubv@bombur.uio.no \
    --to=h.b.furuseth@usit.uio.no \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nkreitzinger@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).