Re: [StGit PATCH] edit: Allow setting git tree SHA1 of a patch

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

 



On 21 May 2010 14:59, David Kågedal <davidk@xxxxxxxxxxxxxx> wrote:
> Catalin Marinas <catalin.marinas@xxxxxxxxx> writes:
>> 2010/5/16 Gustav Hållberg <gustav@xxxxxxxxx>:
>>> I would like to have something similar to this patch, which allows for
>>> setting the (git) tree of a particular patch. I would like to use it
>>> (from the Emacs mode) to make it easier to split an old patch into two
>>> (or more).
>>>
>>> It might be that this is too "powerful" (read: unsafe), and maybe a
>>> better (safer) command would use whatever is currently in the index
>>> rather than a SHA1.
>>
>> I'm not against such option (as long as it is somehow mentioned that's
>> dangerous) though I don't fully understand how one would use it,
>> especially when the patch is buried under other patches. With a series
>> of patches, any easily accessible tree (sha1) belongs to one of the
>> patches.
>
> The idea is that Gustav wants to allow the editing of a file as it
> appears in an earlier version. Lets say you have patches A, B, C and
> D. You realize that one of the changes in to foo.c in C shuold really be
> done in A. So you open the "A version of foo.c" in your editor, do the
> change, and then save it. The save operation needs to update A to be
> the new tree that contains the updated foo.c, and the remaining patches
> will keep their tree. The effect is that the moved change now appears as
> a diff in A, but not in C (nor B or D).

This is currently achieved by "pop B C D", edit file, "refresh", "push
--set-tree B C D".

Can "edit --set-tree <sha1>" make this simpler? Which <sha1> value
would be used with "edit --set-tree" (unless that's done by Emacs mode
behind the scene and it generates the tree that gets passed to edit).

> Working like this means that we don't really see the series as a string
> of patches, but as a series of named commits that we can go back and
> edit. But this is a natural way of working with it once the tools get
> powerful enough to support it.

That's looks a bit difficult (at least to me) since the commits are
usually chained. But, yes, as long as the resulting tree remains he
same, we could freely edit the tree corresponding to intermediate
patches.

-- 
Catalin
--
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]