git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Prohaska <prohaska@zib.de>
To: git@vger.kernel.org
Subject: change push's refspec behavior to match rev-parse
Date: Sun, 14 Oct 2007 10:54:39 +0200	[thread overview]
Message-ID: <11923520851713-git-send-email-prohaska@zib.de> (raw)

This patch series addresses recent complaints about the behavior of push/send-pack
when expanding short refspecs. The overall idea is to change push's handling of
refspecs to match the behavior of rev-parse.


The old way of matching short refspecs in push is often unexpected as
discussed in [1]. Now "git push <ref>" resolves ref the same way as rev-parse.

[1] http://marc.info/?l=git&m=119224567631084&w=2


A related question is how to push only the current branch [2]. Now
"git push HEAD" is supported to push the current head if a matching remote
ref exists.

[2] http://marc.info/?l=git&m=119089831513994&w=2

A summary of the patch series follows below.

    Steffen

 builtin-rev-parse.c   |   27 ++++++++++++-------
 cache.h               |    2 +
 remote.c              |   23 ++++++++++------
 sha1_name.c           |   51 ++++++++++++++++++++++++++++--------
 t/t5516-fetch-push.sh |   68 ++++++++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 138 insertions(+), 33 deletions(-)

 [PATCH 1/6] push, send-pack: fix test if remote branch exists for colon-less refspec

	This is a bug fix that should go to maint. All following patches modifying
        the push test script require this.

 [PATCH 2/6] add get_sha1_with_real_ref() returning full name of ref on demand

	Is required by 3/6 and 4/6

 [PATCH 3/6] rev-parse: teach "git rev-parse --symbolic" to print the full ref name

	A bit off-topic. It demonstrates the use of get_sha1_with_real_ref.

 [PATCH 4/6] push, send-pack: support pushing HEAD to real ref name

	Requires 1/6.

 [PATCH 5/6] add ref_cmp_full_short() comparing full ref name with a short name
 [PATCH 6/6] push, send-pack: use same rules as git-rev-parse to resolve refspecs

	Requires 1/6.

	Note, an updated documentation is not yet included. I like to first wait for
	comments.

             reply	other threads:[~2007-10-14  8:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-14  8:54 Steffen Prohaska [this message]
2007-10-14  8:54 ` [PATCH 1/6] push, send-pack: fix test if remote branch exists for colon-less refspec Steffen Prohaska
2007-10-14  8:54   ` [PATCH 2/6] add get_sha1_with_real_ref() returning full name of ref on demand Steffen Prohaska
2007-10-14  8:54     ` [PATCH 3/6] rev-parse: teach "git rev-parse --symbolic" to print the full ref name Steffen Prohaska
2007-10-14  8:54       ` [PATCH 4/6] push, send-pack: support pushing HEAD to real " Steffen Prohaska
2007-10-14  8:54         ` [PATCH 5/6] add ref_cmp_full_short() comparing full ref name with a short name Steffen Prohaska
2007-10-14  8:54           ` [PATCH 6/6] push, send-pack: use same rules as git-rev-parse to resolve refspecs Steffen Prohaska
2007-10-14  9:05         ` [PATCH 4/6 v2] push, send-pack: support pushing HEAD to real ref name Steffen Prohaska
2007-10-14 17:21     ` [PATCH 2/6] add get_sha1_with_real_ref() returning full name of ref on demand Johannes Schindelin
2007-10-14 21:37       ` Steffen Prohaska
2007-10-14  9:04   ` [PATCH 1/6 v2] push, send-pack: fix test if remote branch exists for colon-less refspec Steffen Prohaska
2007-10-14  9:04 ` change push's refspec behavior to match rev-parse Steffen Prohaska

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=11923520851713-git-send-email-prohaska@zib.de \
    --to=prohaska@zib.de \
    --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).