Darcs vs. git annoyances: pushing specific patches

With darcs, it’s easy to push a limited number of patches, instead of everything in the branch. There are several ways to do this:

The default is interactively:

$ darcs push 

Tue Jan  1 22:33:33 EST 2008  Mark Stosberg <mark@stosberg.com>
  * RT#1234: new subsystem
Shall I push this patch? (1/1)  [ynWsfvpxdaqjk], or ? for help:

Even if you’ve never used darcs, before it’s easy to figure what to do. You might press “?” for help:

How to use push:
y: push this patch
n: don't push it
w: wait and decide later, defaulting to no

s: don't push the rest of the changes to this file
f: push the rest of the changes to this file

v: view this patch in full
p: view this patch in full with pager
x: view a summary of this patch

d: push selected patches, skipping all the remaining patches
a: push all the remaining patches
q: cancel push

j: skip to next patch
k: back up to previous patch

?: show this help

I like to use “x” to review which files I’m about to push, or “p” to review the patch in a pager. I haven’t yet found that git has this kind of review possibility built into the workflow. Also with darcs, it’s easy to push just one patch:

$ darcs push -p 'new subsystem'

It’s also very useful to push all the patches related to a specific ticket or project:

$ darcs push -p 'RT#1234'

In darcs we call that spontaneous branches because you get some benefits of a branch, without actually doing anything to create one.

The related user experience with git push is worse in a couple significant ways. First, I don’t see a way to use the human readable patch name. A separate step is required to review ‘git log’ to find the SHA1 hash, which must be copy/pasted, because there’s no way you remember it like a human-friendly word or phrase like darcs allows.

Armed with that, you ready to start the four step process that git requires to push specific patches, by creating a new branch, ‘cherry-picking’ to it, doing the push, and then deleting the new branch

$ git checkout --track -b <tmp local branch> origin/<remote branch>
$ git cherry-pick -x <sha1 refspec of commit from other (local or remote) branch>
$ git push origin <tmp local branch>
$ git branch -D <tmp local branch>

It’s because of a number of annoyances like this that I continue to use darcs whenever I can, and git when I have to.

Leave a comment

Recent Entries

  • generating HTTP headers: sorted or unsorted?

    Recently I've been reviewing how various Perl frameworks and modules generate HTTP headers. After reviewing several approaches, it's clear that there are two major...

  • The cost of saving sent e-mail

    I don't tap my own phone. I don't xerox postcards before I mail them back from vacation. I don't take a voice recorder when...

  • Modifying PDFs so they open full screen

    The [PDF spec](http://www.adobe.com/devnet/pdf/pdf_reference_archive.html) includes an option to cause PDFs to open full screen when users open them. I'm a fan of the feature because...

  • Stewardship and Sustainability of our online lives

    A few weeks ago I had my laptop stolen. Earlier that morning I had been reflecting and writing on the laptop about the intersection...

  • A vision for CGI.pm and CGI::Simple

    I've spent a lot time recently [triaging bugs for CGI.pm](http://mark.stosberg.com/blog/2009/08/almost-100-cgipm-bugs-closed-help-with-the-50-still-open.html). I've enjoyed the process, and respect CGI.pm as a widely used Perl module. I'm...

Close