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

Re: git fetch --all --depth

From
KKKacper Kornet <kornet@camk.edu.pl>
Date
Jul 21, 2011, 20:04 UTC
Message-ID
<20110721200455.GC11520@camk.edu.pl>
In-Reply-To
<7v1uxj4ml4.fsf@alter.siamese.dyndns.org>
On Thu, Jul 21, 2011 at 09:36:55AM -0700, Junio C Hamano wrote:
> Kacper Kornet <kornet@camk.edu.pl> writes:
> > I have just discovered that when I use:
> > git fetch --all --depth=<n> 
> > the history is not deepened. Is the any specific reason for it or is it
> > a bug?
> The above is not specific enough to judge if you found a bug or if it is a
> user error.
To be more specific, the steps to reproduce:

$ git clone --depth=1 git://git.kernel.org/pub/scm/git/git.git $ cd git $ git fetch --depth 2 --all

and the last command does nothing, while
$ git fetch --depth 2 
deepens the clone by 2 repos, as expected.
Show 6 quoted lines
> IIRC, --depth=<n> is not "deepen by <n>", but "make sure I have at least
> <n> from the updated tip(s)".  The shallow-clone hack gives you quite
> useless (even though it may be internally consistent) semantics if you
> shallow-cloned way in the past and fetched with --depth after the other
> side added many more commits than <n>, as you cannot guess what the right
> value of <n> should be without actually fetching without --depth.

That is true. Also, from esthetic point of view, sometimes I miss the functionality to deepen the full repository. For example git fetch --depth 0 could do it. Now I have to do git fetch --depth <very_large_number>

-- 
  Kacper Kornet
Previous: Junio C HamanoNext: ZAK Magnus
Message 3 of 4 in “git fetch --all --depth”
  1. Kacper KornetJul 20, 2011
  2. Junio C HamanoJul 21, 2011
  3. Kacper KornetJul 21, 2011
  4. ZAK MagnusJul 21, 2011

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.