Subject: Re: [PATCH v2 9/9] fetch: allow explicit --refmap to override configuration

From: Junio C Hamano <[email-masked]>
Date: Thu, 05 Jun 2014 11:36:56 -0700

Marc Branchaud <[email-masked]> writes:

> I don't have any objection to the option per se.  But I do wonder if there's
> a need to add yet another knob to git just for completeness.  Has anyone ever
> needed this?

It is not a good yardstick, as everybody has survived without it
since Git's inception.  The right question to ask is: would it help
new use patterns, or improve existing use patterns?

Two possible scenarios I can think of offhand are

 * using an empty refmap to ensure that your "fetch" this time is
   really ephemeral without affecting the longer-term configured
   remote-tracking branches

 * grabbing only a few selected branches out of hundreds, e.g.

   $ git fetch https://github.com/gitster/git \
       --refmap=refs/heads/*:refs/remotes/jch/* maint master next +pu

   instead of having to spell its long-hand

   $ git fetch https://github.com/gitster/git \
       refs/heads/maint:refs/remotes/jch/maint \
       refs/heads/master:refs/remotes/jch/master \
       refs/heads/next:refs/remotes/jch/next \
       +refs/heads/pu:refs/remotes/jch/pu

but there may be more useful scenarios other people can come up
with ;-).