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

Re: [PATCH] Fixes handling of --reference argument.

From
W. Trevor King <wking@tremily.us>
Date
Oct 25, 2012, 10:45 UTC
Message-ID
<20121025104519.GA3816@odin.tremily.us>
In-Reply-To
<20121025083625.GA8390@sigill.intra.peff.net>
On Thu, Oct 25, 2012 at 04:36:26AM -0400, Jeff King wrote:
Show 16 quoted lines
> On Wed, Oct 24, 2012 at 09:52:52PM -0700, szager@google.com wrote:
> > diff --git a/git-submodule.sh b/git-submodule.sh
> > index ab6b110..dcceb43 100755
> > --- a/git-submodule.sh
> > +++ b/git-submodule.sh
> > @@ -270,7 +270,6 @@ cmd_add()
> >  			;;
> >  		--reference=*)
> >  			reference="$1"
> > -			shift
> >  			;;
> 
> Is that right? We'll unconditionally do a "shift" at the end of the
> loop. If it were a two-part argument like "--reference foo", the extra
> shift would make sense, but for "--reference=*", no extra shift should
> be neccessary. Am I missing something?

Both the patch and Jeff's analysis are right. You only need an in-case shift if you consume "$2", or you're on ‘--’ and you're breaking before the end-of-case shift.

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
Previous: Jeff KingNext: Jens Lehmann
Message 3 of 5 in “Fixes handling of --reference argument.”
  1. Fixes handling of --reference argument.szager@google.com, Oct 25, 2012
  2. Jeff KingOct 25, 2012
  3. W. Trevor KingOct 25, 2012
  4. Jens LehmannOct 25, 2012
  5. Jeff KingOct 26, 2012

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.