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

Re: I: git-fetch: -n option disappeared but git-fetch(1) still describe it

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 12, 2008, 16:11 UTC
Message-ID
<alpine.LSU.1.00.0803121710460.1656@racer.site>
In-Reply-To
<47D7FF8E.5040700@op5.se>
Hi,
On Wed, 12 Mar 2008, Andreas Ericsson wrote:
Show 37 quoted lines
> Johannes Schindelin wrote:
> 
> > On Wed, 12 Mar 2008, Andreas Ericsson wrote:
> > 
> > > Dmitry V. Levin wrote:
> > >
> > > > git-fetch builtinification (commit v1.5.3.2-93-gb888d61) 
> > > > apparently dropped -n option (alias to --no-tags) documented in 
> > > > Documentation/fetch-options.txt
> > > >
> > > > Either builtin-fetch.c or Documentation/fetch-options.txt should 
> > > > be adjusted to sync the code with its docs.
> > > >
> > > > Original bug report: 
> > > > https://bugzilla.altlinux.org/show_bug.cgi?id=14870
> > > I have a (very) vague memory that git-fetch.sh had to iterate over 
> > > tags one by one, making tag-heavy projects excruciatingly slow to 
> > > fetch from with the shellscript version. Some pathological case with 
> > > 2700 tags was presented where a fetch took nearly an hour, iirc. 
> > > AFAIR, the builtinification (or was it a protocol extension?) 
> > > reduced that time to something around 10 seconds for the 
> > > pathological case.
> > 
> > AFAIR this was helped by the fetch--tool helper, even at the time of 
> > non-builtin fetch.
> > 
> > > Does anyone else have a sharper memory of what caused the -n option 
> > > to be dropped?
> > 
> > AFAICT this was done because of the parsopt'ification.  But I forgot 
> > the details.
> > 
> 
> I had a look at the code. It seems the new way of specifying -n is to 
> say --no-tags or -t 0, or --tags=0 (although I'm not well-versed enough 
> in the parseopt thing to be sure). I have no time now, but I'll take a 
> stab at adding the -n option back tomorrow if nobody beats me to it.
Maybe like this (completely untested, that will be your task tomorrow):
 builtin-fetch.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 5196688..c406298 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -40,6 +40,8 @@ static struct option builtin_fetch_options[] = {
 		    "force overwrite of local branch"),
 	OPT_SET_INT('t', "tags", &tags,
 		    "fetch all tags and associated objects", TAGS_SET),
+	OPT_SET_INT('n', NULL, &tags,
+		    "do not fetch all tags (--no-tags)", TAGS_UNSET),
 	OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
 	OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
 		    "allow updating of HEAD ref"),
Previous: Andreas EricssonNext: Andreas Ericsson
Message 5 of 8 in “I: git-fetch: -n option disappeared but git-fetch(1) still describe it”
  1. Dmitry V. LevinMar 12, 2008
  2. Andreas EricssonMar 12, 2008
  3. Johannes SchindelinMar 12, 2008
  4. Andreas EricssonMar 12, 2008
  5. Johannes SchindelinMar 12, 2008
  6. Andreas EricssonMar 13, 2008
  7. git fetch: Take '-n' to mean '--no-tags'Andreas Ericsson, Mar 13, 2008
  8. Junio C HamanoMar 13, 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.