title: How to pull one commit at a time from a remote git repository?
body: <p>I'm trying to set up a darcs mirror of a git repository.  I have something that works OK, but there's a significant problem: if I push a whole bunch of commits to the git repo, those commits get merged into a single darcs patchset.  I really want to make sure each git commit gets set up as a single darcs patchset.  I bet this is possible by doing some kind of <code>git fetch</code> followed by interrogation of the local copy of the remote branch, but my git fu is not up to the job.</p>
  
  <p>Here's the (ksh) code I'm using now, more or less:</p>
  
  <pre><code>git pull -v # pulls all the commits from remote --- bad!
  
  # gets information about only the last commit pulled -- bad!
  author="$(git log HEAD^..HEAD --pretty=format:"%an &lt;%ae&gt;")"
  logfile=$(mktemp)
  git log HEAD^..HEAD --pretty=format:"%s%n%b%n" &gt; $logfile
  
  # add all new files to darcs and record a patchset. this part is OK
  darcs add -q --umask=0002 -r .
  darcs record -a -A "$author" --logfile="$logfile"
  darcs push -a
  rm -f $logfile
  </code></pre>
  
  <p>My idea is </p>
  
  <ol>
  <li>Try <code>git fetch</code> to get local copy of the remote branch (not sure exactly what arguments are needed)</li>
  <li>Somehow interrogate the local copy to get a hash for every commit since the last mirroring operation (I have no idea how to do this)</li>
  <li>Loop through all the hashes, pulling just that commit and recording the associated patchset (I'm pretty sure I know how to do this if I get my hands on the hash)</li>
  </ol>
  
  <p>I'd welcome either <strong>help fleshing out the scenario above</strong> or suggestions about <strong>something else I should try.</strong></p>
  
  <p>Ideas?</p>