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

Re: Questions/investigations on git-subtree and tags

From
JRJeremy Rosen <jeremy.rosen@openwide.fr>
Date
Mar 8, 2013, 17:29 UTC
Message-ID
<886271566.251606.1362763771332.JavaMail.root@openwide.fr>
In-Reply-To
<7vboathkla.fsf@alter.siamese.dyndns.org>
----- Mail original -----
Show 17 quoted lines
> Jeremy Rosen <jeremy.rosen@openwide.fr> writes:
> 
> > 506,513c506,507
> > < 		case "$2" in
> > < 		*\**) # Avoid pulling in multiple branches
> > < 			die "'$2' contains a wildcard"
> > < 			;;
> > < 		*:*) # Don't create a local branch for the subtree
> > < 			die "'$2' contains a local branch name"
> > < 			;;
> > < 		esac
> > ---
> >> 		git ls-remote --exit-code $1 $2 ||
> 
> You would need to quote $1 and $2 properly to prevent the shell from
> splitting them into words, no?
> 
yes... I'm not very good at shell programming, good catch
Show 12 quoted lines
> >> 		die "'$2' is not a correct reference on '$1'"
> 
> > 535c529
> > < 	revs=$(git rev-parse $default --revs-only "$@") || exit $?
> > ---
> >> 	revs=$(git rev-parse $default --revs-only "$1^{commit}") || exit
> >> 	$?
> 
> Is it guaranteed that your $# is 1 at this point, or is it something
> you would also need to check here, or perhaps in the caller of this
> function (I cannot tell offhand in a patch without any context)?
> 

I have checked the call sites and yes we can only have one arguement at this point. so the $@ to $1 is more about future-proofing and readability

thx for proofreading
Previous: Junio C HamanoNext: Jeremy Rosen
Message 12 of 14 in “Questions/investigations on git-subtree and tags”
  1. Jeremy RosenMar 7, 2013
  2. Paul CampbellMar 7, 2013
  3. Jeremy RosenMar 7, 2013
  4. Paul CampbellMar 7, 2013
  5. Jeremy RosenMar 7, 2013
  6. Paul CampbellMar 7, 2013
  7. Jeremy RosenMar 7, 2013
  8. Paul CampbellMar 7, 2013
  9. Jeremy RosenMar 7, 2013
  10. Jeremy RosenMar 8, 2013
  11. Junio C HamanoMar 8, 2013
  12. Jeremy RosenMar 8, 2013
  13. Jeremy RosenMar 12, 2013
  14. Paul CampbellMar 12, 2013

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.