git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* change push's refspec behavior to match rev-parse
@ 2007-10-14  8:54 Steffen Prohaska
  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  9:04 ` change push's refspec behavior to match rev-parse Steffen Prohaska
  0 siblings, 2 replies; 12+ messages in thread
From: Steffen Prohaska @ 2007-10-14  8:54 UTC (permalink / raw)
  To: git

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-10-14 21:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-14  8:54 change push's refspec behavior to match rev-parse Steffen Prohaska
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

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).