git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Permit refspec source side to parse as a sha1

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2008, 04:50 UTC
Message-ID
<7vabksu1ct.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7v4pb0vhrg.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
> I really think we cannot afford piling hacks on top of hacks to hide the
> broken interface forever.  We have two different things to validate, and
> the callers all know what they have when calling us to validate.  We
> should not have a single loose validation that only catches "it cannot be
> either fetch nor push refspec" breakage.
> ...
> But at least I think something like this patch would lead us in the right
> direction.
On top of the one I sent out, with this patch, you can:
	$ git push other ':/remote show:refs/heads/new'
to send the commit you would review with "git show ':/remote show'".
---
 builtin-send-pack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-send-pack.c b/builtin-send-pack.c
index 930e0fb..bb9c33a 100644
--- a/builtin-send-pack.c
+++ b/builtin-send-pack.c
@@ -537,7 +537,7 @@ static void verify_remote_names(int nr_heads, const char **heads)
 	int i;
 
 	for (i = 0; i < nr_heads; i++) {
-		const char *remote = strchr(heads[i], ':');
+		const char *remote = strrchr(heads[i], ':');
 
 		remote = remote ? (remote + 1) : heads[i];
 		switch (check_ref_format(remote)) {
Previous: Junio C HamanoNext: Daniel Barkalow
Message 3 of 20 in “Permit refspec source side to parse as a sha1”
  1. Permit refspec source side to parse as a sha1Daniel Barkalow, Mar 21, 2008
  2. Junio C HamanoMar 21, 2008
  3. Junio C HamanoMar 21, 2008
  4. Daniel BarkalowMar 21, 2008
  5. Junio C HamanoMar 21, 2008
  6. Daniel BarkalowMar 21, 2008
  7. Junio C HamanoMar 21, 2008
  8. Daniel BarkalowMar 21, 2008
  9. remote.c: Fix overtight refspec validationJunio C Hamano, Mar 21, 2008
  10. Daniel BarkalowMar 21, 2008
  11. Junio C HamanoMar 21, 2008
  12. Daniel BarkalowMar 22, 2008
  13. Junio C HamanoMar 22, 2008
  14. Daniel BarkalowMar 22, 2008
  15. Linus TorvaldsMar 26, 2008
  16. Junio C HamanoMar 26, 2008
  17. Junio C HamanoMar 26, 2008
  18. Daniel BarkalowMar 26, 2008
  19. Junio C HamanoMar 26, 2008
  20. Jeff KingMar 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.