[darcs-devel] darcs pull --skip-merge-working
Ben Franksen
ben.franksen at online.de
Mon Mar 15 08:31:33 UTC 2021
Am 13.03.21 um 20:06 schrieb Henning Thielemann:
>
> I like to have an option that pulls in patches from elsewhere but does
> not touch the working tree.
Me too!
That would be very useful, and, now that I think about it, actually
quite easy to implement.
The new option should be available for all commands that add or remove
patches: apply, pull, push, rebase suspend/unsuspend, etc.
Interestingly, for obliterate we do have a separate command with that
effect, namely unrecord.
Not yet sure about the name of the option; a shorter alternative to
--skip-merge-working would be --keep-working.
Would you mind creating a ticket or should I?
> Motivation
>
> It happens occasionally that I make changes to a working tree that
> should be better split into several patches. However, I want to prepare
> patches that are consistent. Thus, say I have repository A with many
> changes that are too many for one patch. Now I create a repository clone
> B and transfer selected changes from A's working tree to B ones using a
> tool like 'meld' until B reaches a consistent state (i.e. can be
> compiled and tested successfully). Now I record a new patch in B. I go
> back to A and try "darcs pull ../B". But this will cause a lot of
> conflicts with A's working tree. However I do not want merging with A's
> working tree because it is already in a consistent state. Thus I'd
> prefer to do "darcs pull --skip-merge-working ../B".
Yes, I am in the same situation pretty often.
> Workaround
>
> Here is what I currently do instead: I create another working copy that
> shares the patches with A using a symbolic link:
>
> $ mkdir A_shadow
> $ cd A_shadow
> A_shadow$ ln -s ../A/_darcs
> A_shadow$ darcs revert -a
> A_shadow$ darcs pull ../B
>
> An ugly hack, isn't it?
True. This is similar to the sort of hack I use when tracking changes
between releases of some upstream project that doesn't use darcs: I
unpack the new release (tar ball, or git clone), then cp -r .../_darcs
into that, darcs record -lam 'import release 1.2.3', then push the patch
back into my darcs repo.
Cheers
Ben
--
Niemand hat das Recht zu gehorchen. -- Hannah Arendt
More information about the darcs-devel
mailing list