4 ms·
What you can't do with git is pull a set of related patches when you have not created a branch for them. Which is apparently useful, as git has cherry-pick for
by riffraff 15y ago
What you can't do with git is pull a set of related patches when you have not created a branch for them. Which is apparently useful, as git has cherry-pick for that, and rebase.
Except, cherry pick will only work for "in air" commits, and rebase requires you to review all the commits.
darcs will happily pull a set of related commits knowing the relations between them.
You may have detailed knowledge of the system so in some cases you may do something better than what darcs does, but that does not mean you should be resolving merges and commit dependencies by hand all of the time.
Honestly, I have not used darcs in years, but that is the "right" thing I expect from a VCS, and it has no downsides per se[0].
[0]they may be in darcs implementation, or possibly in the theory, but definitely not in the feature
- klodolph 15y agoRebase only requires you to review the commits to the same extent that merge does, unless you're doing an interactive rebase. Honestly, I expect the differences between Darcs and Git in terms of rebase / interactive rebase / cherry pick / merge to be a matter of implementation. Both systems are fed the same input, both track enough of it, so both could theoretically provide the same output. (I think Darcs is a little better at it, but every merge should be done with a watchful eye in either system.) But I get the feeling that the patch-centric model is encouraging users to play fast and loose with patch order. If you wantonly reorder patches, you might get a sequence of unusable code bases culminating in the current working version of your software. It's easy to move a patch that uses a feature to a point before the feature is introduced. Basically, the claim that "Darcs automatically groups changes which depend on each other" is one that I can't take seriously. How can it know which changes depend on each other, if (for example) they're in different files? By comparison, I hear from the Git folk advice along the lines of, "Be careful with rebase, because it is a destructive operation". And because Git is snapshot-centric, if the app crashes in testing you can look at the SHA-1 used for the build to check out the exact tree used for the build, even years later, if necessary. No tagging required.
- riffraff 15y ago> It's easy to move a patch that uses a feature to a point before the feature is introduced. Well, if you use git yes, since there is no check for this, in the normal darcs workflow either the patches are independent or you can't reorder them. So, "fix About" can be moved before "new login screen", but "using data in the new login screen" cannot. > How can it know which changes depend on each other, if (for example) they're in different files? Because _you_ told it so, by making them part of a single commit, or by creating a commit which depends on lines in both files affected by previous commits in those files, or by tagging the repo. Surely it's not a crazy idea to group related changes across files in a single commit :) E.g. # distinct commits A1 "added foo() in foo.c" B1 "added foo() in foo.h" # depends on b1, if you cherry pick this you get B1, B2 B2 "added ifdef in foo.h" # depends on all three, you get A1, B1, B2, C1 C1 "renaming foo() to bar()" # depends on all four, you get A1, B1, B2, C1, C2 C2 "renaming foo.(c,h) to bar(.c,.h)" Notice that yes, you can miss a commit, or include too much. In the worst case you end up with the same "I'll review the commits" workflow you use in git cherry-pick/merge/rebase. FWIW, I am not advocating darcs over git, just trying to shed some light.
- loup-vaillant 15y agoLet's say I do this: # distinct commits A "added foo() in foo.h and foo.c" B "used foo() in bar.c" Clearly, B depends on A. There's no textual dependency, however. How do I tell Darcs about that?
- etherealG 15y agothis is a critical reason why git makes sense to me, cause all non trivial code changes conflict, and then need to be resolved with understanding of the underlying code. the only way to reorder these in git is with rebase, but that is flagged as a dangerous tool, and with good reason. if darcs can find a way to do this it would really be worth switching to, but if not then it would fall short in it's claim of safely being able to reorder patches. doing so behind the scene automatically would really worry me about code integrity.