Re: How to commit incomplete changes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]