Re: recommendation for patch maintenance

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

 



Manlio Perillo <manlio.perillo@xxxxxxxxx> writes:

> I lose the history of all the changes I have made to produce the final
> version of a patch.
>
> Since for every new version of a patch I do a commit --amend, I can not
> see, as an example, the changes I have made between x and y versions of
> a patch.
>
> Of course the commits are not really lost, but I have to search them
> using the reflog.

Yeah, these days with "rebase -i" that does not leave individual
steps as separate reflog entries, for an easy series, you can do
things like:

    $ git rebase -i ;# work on polishing the series
    $ git show-branch -g ;# view where it diverged
    $ git diff HEAD~4 @{1}~4

Of course you can plan ahead (this is what I usually do when working
on a series that is not "how about this" throw-away patch I send to
this list all the time) and name the topic "topic-v1", fork the new
round "topic-v2", "topic-v3", etc. and do things like

    $ sh -c 'git diff topic-v2~$1 topic-v3~$1' - 4

(the point being that then you do ^P or whatever shell command
history mechanism to recall that line, edit "4" to "3" and rerun the
comparison for other corresponding ones).

On a related but different front, I've been thinking about improving
the "format-patch --subject-prefix" mechanism to make it even easier
to use.  With the current interface, when you prepare your reroll,
you would do:

    $ git format-patch --cover-letter \
        --subject-prefix='PATCH v4' -o ./+mp master

and end up overwriting the patches from the previous round (if their
subject did not change).  You will always overwrite the cover
because its subject never changes and that is where the filename is
taken from.

What if we added another option, say --reroll $n (or -v$n), to let
you write:

    $ git format-patch --cover-letter -v4 -o ./+mp master

that produces output files named like:

    ./+mp/v4-0000-cover-letter.txt
    ./+mp/v4-0001-git-completion.bash.add-support-for-pa.txt

with the subject '[PATCH v4]' prefix?

Then you can transplant the cover letter material from the cover
letter from the older iteration to the new cover letter in your
editor, and sending them out will become

    $ git send-email ... ./+mp/v4-*.txt

Hmm?
--
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]