[darcs-users] some special amend-records
david.leuschner at gmail.com
Sat Mar 23 20:44:13 UTC 2013
Hi Piyush, hi Ganesh,
> (1) Cherry pick the changes to the working copy of the repository. Let
> us call this picked patch p.
> (2) Go over the list of patches in the reverse order (i.e. p4 then p3
> then p2) as long as p commutes over them.
> (3) When the user says stop then merge p and the current patch.
I'd also like this feature very much. This is one of the use-cases I
had in mind when we were talking about splitting/merging of patches,
grouping of patches and tags as patch groups. The new "record-amend"
command from above could either be seen as merging patches (in step 3)
and thereby changing the identity of p2. But if every hunk from the
p0...p4 sequence had been recorded as a separate patch this could also
be seen as just recording a new patch and changing the patch group
"p2" to containing p2 and the new patch p.
If the patch group change would be a primitive patch (such as a hunk)
even this change could be don't without changing any identities.
(We'd need the primitive operations "new-group", "add to group" and
"remove from group".)
Some more thoughts about "patch identities":
Darcs has a very technical view concerning identities. That's natural
because Darcs is a program. But it doesn't work very well with humans
because we have a different view on the identities of the things we're
working on. When working with Darcs we have to learn how Darcs
handles identities and not only think about our identities but also
how Darcs commands change identities. For me as a human "a patch" is
some feature I am working on. The identity comes from the feature I'm
working on. For me the identity doesn't change if I change or improve
my work. But the Darcs patch identity changes. Of course I understand
why it changes but it's still not what I want. Often I'd like to share
some preview version of my feature with a colleague. After some
feedback I continue working on the feature. With Darcs my colleague
and I have to decide and communicate if he can keep my patch because I
won't amend-record it or if I may amend-record it and he has to unpull
it and wait for my new version. We only have to do this because Darcs
doesn't support a good way of recording the changes to a "feature".
Many conflicts only arise because of the patch-identity problem and
because somebody didn't think enough about Darcs identities - not
because there are real conflicts.
I'd like to have an identity that doesn't change when I add more
changes to a feature. I'd like my colleagues to keep any version they
have of my feature and still be able to get the changes I did to that
feature. All that is possible: just never use amend-record when you
share patches. But this leads to MANY patches just for a single thing
(the feature I am working on). If a team of 6 developers is closely
working full-time on different features this leads to hundreds of
patches and it's very difficult to see the big picture because of all
those small patches. It's also not very convenient because when I
want to see what is changed by a feature I might have to look at 10
patches and it's much more difficult to get a diff for all those 10
patches combined. (For example I can't to that when pulling, pushing
or looking at darcs changes.)
I'd love to work with patch groups instead. I'd like to pull from the
head repository and see something like this
$ darcs pull
Pulling from "dleuschner at darcs.umidev.de:repos/DociGateway"...
* feature: foo
12 more patches by Alex, Jonny and Stefan from Feb 25 10:30:23 to
Feb 29 12:21:33 CET 2013
Shall I pull all these patches or do you want to pick single patches? [yn...] y
* feature: bar
3 more patches by David, Dirk and Niklas
Shall I pull all these patches or do you want to pick single patches? [ync...] p
Mon Feb 25 10:30:23 CET 2013 spoeri at factisresearch.com
* added nurses for demo data
Shall I pull this patch? (1/3) [ynW...], or ? for more options: q
I'd then like to do something such as
$ darcs unpull -g "feature: foo"
* feature: foo
21 patches by Alex, Jonny and Stefan from Feb 25 10:30:23 to Feb 29
12:21:33 CET 2013
Shall I unpull all these patches? [ynq...]
to get rid of the feature alltogether or
$ darcs record -m "added more tests" -g "feature: bar"
to add something.
This is just a vague idea seen from a user perspective. I think if we
had a good way of naming groups of small patches we'd maybe not need
amend-record at all because nobody would care how many iterations my
"patch" went through because everybody except the developers would
only consider the resulting patch group.
Would this be something useful for other Darcs users?
More information about the darcs-users