From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 0/3] Teaching "git push" to map pushed refs
Date: Wed, 4 Dec 2013 17:27:26 -0800 [thread overview]
Message-ID: <1386206849-6503-1-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1386117594-22062-1-git-send-email-gitster@pobox.com>
The 'master' refspec in "git fetch origin master" used to mean "We
grab their 'master' branch, but we do not store it in any of our
remote-tracking branches." but in modern Git, the remote-tracking
branch that would receive updates from 'master' with a corresponding
"git fetch origin" (without any specific refs on the command line)
is updated. Updating the same refs/remotes/origin/master with
git fetch origin
git fetch origin master
avoids surprises.
However, we did not have a similar refspec mapping on the push side.
This three-patch series does just that. It would help triangular
workflow by making these two:
git checkout master && git push origin
git push origin master
update the same ref at the 'origin'. It also would help those who
need to emulate a fetch run on mothership from satellite with a push
run on satellite into mothership (due to e.g. network connectivity
issues).
The second round avoids instantiating the remote and the list of
local heads until the very last minute when they are actually
needed (the change is in the second patch).
Junio C Hamano (3):
builtin/push.c: use strbuf instead of manual allocation
push: use remote.$name.push as a refmap
push: also use "upstream" mapping when pushing a single ref
Documentation/git-push.txt | 9 +++--
builtin/push.c | 84 ++++++++++++++++++++++++++++++++++------------
remote.c | 8 ++---
remote.h | 2 ++
t/t5516-fetch-push.sh | 75 +++++++++++++++++++++++++++++++++++++++++
5 files changed, 150 insertions(+), 28 deletions(-)
--
1.8.5.1-402-gdd8f092
next prev parent reply other threads:[~2013-12-05 1:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 0:39 [PATCH 0/3] Teaching "git push" to map pushed refs Junio C Hamano
2013-12-04 0:39 ` [PATCH 1/3] builtin/push.c: use strbuf instead of manual allocation Junio C Hamano
2013-12-04 0:39 ` [PATCH 2/3] push: use remote.$name.push as a refmap Junio C Hamano
2013-12-04 0:39 ` [PATCH 3/3] push: also use "upstream" mapping when pushing a single ref Junio C Hamano
2013-12-05 1:27 ` Junio C Hamano [this message]
2013-12-05 1:27 ` [PATCH v2 1/3] builtin/push.c: use strbuf instead of manual allocation Junio C Hamano
2013-12-05 1:27 ` [PATCH v2 2/3] push: use remote.$name.push as a refmap Junio C Hamano
2013-12-05 1:27 ` [PATCH v2 3/3] push: also use "upstream" mapping when pushing a single ref Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386206849-6503-1-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).