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
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 21, 2008, 16:08 UTC
Message-ID
<alpine.LNX.1.00.0803211148120.19665@iabervon.org>
In-Reply-To
<7v3aqksic6.fsf@gitster.siamese.dyndns.org>
On Thu, 20 Mar 2008, Junio C Hamano wrote:
Show 16 quoted lines
> Daniel Barkalow <barkalow@iabervon.org> writes:
> 
> > On Thu, 20 Mar 2008, Junio C Hamano wrote:
> > ...
> >> In any case, don't you agree that the patch you responded to is much
> >> easier to understand what we are (and we are not) checking than the
> >> original code?
> >
> > No, I think it's much more complicated. It mixes the semantics of what an 
> > empty side means for a particular use of refspecs into the parsing of the 
> > string. At the very least, the checks should be outside of _internal() in 
> > the functions for particular uses.
> 
> The thing is, the syntax is the same between fetch and push only to a
> degree.  They are both <LHS> ':' <RHS>.  What is allowed on LHS and RHS
> are quite different even at the syntactic level.

There's also the optional + at the beginning and the way of forming patterns, and the need to distinguish not having a colon with not having anything on one or the other side of the colon.

> I already know our criteria when judging if a particular code is clean or
> complex are _vastly_ different, from the experience working with you in
> other parts of the system (namely, read-tree 3-way rules and
> unpack_trees() rewrite that happened quite a long time ago).
Agreed.

And I do think that the rewrite of the part of the function before the semantic checks is clearer than the corresponding original (although the patch text made it hard to see; we really need some magic to make diff not bother to save 4 identifier-free lines and just show it as a complete replacement).

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.