{"thread":{"id":"27870","subject":"git fetch --all --depth","startedAt":"2011-07-20T22:39:02Z","lastAt":"2011-07-21T20:40:54Z","messageCount":4,"participants":["Kacper Kornet","Junio C Hamano","ZAK Magnus"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"171758","messageId":"20110720223902.GA6675@camk.edu.pl","threadId":"27870","inReplyTo":null,"subject":"git fetch --all --depth","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-07-20T22:39:02Z","receivedAt":"2011-07-20T22:39:02Z","isPatch":false,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"Hi,\n\nI have just discovered that when I use:\n\ngit fetch --all --depth=<n> \n\nthe history is not deepened. Is the any specific reason for it or is it\na bug?\n\n-- \n  Kacper Kornet\n"},{"id":"171773","messageId":"7v1uxj4ml4.fsf@alter.siamese.dyndns.org","threadId":"27870","inReplyTo":"20110720223902.GA6675@camk.edu.pl","subject":"Re: git fetch --all --depth","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-07-21T16:36:55Z","receivedAt":"2011-07-21T16:36:55Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> I have just discovered that when I use:\n>\n> git fetch --all --depth=<n> \n>\n> the history is not deepened. Is the any specific reason for it or is it\n> a bug?\n\nThe above is not specific enough to judge if you found a bug or if it is a\nuser error.\n\nIIRC, --depth=<n> is not \"deepen by <n>\", but \"make sure I have at least\n<n> from the updated tip(s)\".  The shallow-clone hack gives you quite\nuseless (even though it may be internally consistent) semantics if you\nshallow-cloned way in the past and fetched with --depth after the other\nside added many more commits than <n>, as you cannot guess what the right\nvalue of <n> should be without actually fetching without --depth.\n"},{"id":"171814","messageId":"20110721200455.GC11520@camk.edu.pl","threadId":"27870","inReplyTo":"7v1uxj4ml4.fsf@alter.siamese.dyndns.org","subject":"Re: git fetch --all --depth","fromName":"Kacper Kornet","fromEmail":"kornet@camk.edu.pl","sentAt":"2011-07-21T20:04:55Z","receivedAt":"2011-07-21T20:04:55Z","isPatch":false,"sender":{"key":"kornet@camk.edu.pl","avatar":null},"body":"On Thu, Jul 21, 2011 at 09:36:55AM -0700, Junio C Hamano wrote:\n> Kacper Kornet <kornet@camk.edu.pl> writes:\n\n> > I have just discovered that when I use:\n\n> > git fetch --all --depth=<n> \n\n> > the history is not deepened. Is the any specific reason for it or is it\n> > a bug?\n\n> The above is not specific enough to judge if you found a bug or if it is a\n> user error.\n\nTo be more specific, the steps to reproduce:\n\n$ git clone --depth=1 git://git.kernel.org/pub/scm/git/git.git\n$ cd git\n$ git fetch --depth 2 --all\n\nand the last command does nothing, while\n\n$ git fetch --depth 2 \n\ndeepens the clone by 2 repos, as expected.\n\n> IIRC, --depth=<n> is not \"deepen by <n>\", but \"make sure I have at least\n> <n> from the updated tip(s)\".  The shallow-clone hack gives you quite\n> useless (even though it may be internally consistent) semantics if you\n> shallow-cloned way in the past and fetched with --depth after the other\n> side added many more commits than <n>, as you cannot guess what the right\n> value of <n> should be without actually fetching without --depth.\n\nThat is true. Also, from esthetic point of view, sometimes I miss the\nfunctionality to deepen the full repository. For example git fetch\n--depth 0 could do it. Now I have to do git fetch --depth\n<very_large_number>\n\n-- \n  Kacper Kornet\n"},{"id":"171820","messageId":"CAAuSN90Ai7KD68fwRtRUkP4tm61=CcEc_9-kH0Dh5mdAT4hOpg@mail.gmail.com","threadId":"27870","inReplyTo":"20110721200455.GC11520@camk.edu.pl","subject":"Re: git fetch --all --depth","fromName":"ZAK Magnus","fromEmail":"zakmagnus@google.com","sentAt":"2011-07-21T20:40:54Z","receivedAt":"2011-07-21T20:40:54Z","isPatch":false,"sender":{"key":"zakmagnus@google.com","avatar":null},"body":"Looks like a bug. I believe the culprit is add_options_to_argv(),\nwhich is used by fetch_multiple() to copy command line arguments to a\nchild process, but does not copy the --depth argument. Thus --all (and\neverything else that relies on fetch_multiple() or\nadd_options_to_argv()) ignores --depth.\n\nOn Thu, Jul 21, 2011 at 1:04 PM, Kacper Kornet <kornet@camk.edu.pl> wrote:\n> On Thu, Jul 21, 2011 at 09:36:55AM -0700, Junio C Hamano wrote:\n>> Kacper Kornet <kornet@camk.edu.pl> writes:\n>\n>> > I have just discovered that when I use:\n>\n>> > git fetch --all --depth=<n>\n>\n>> > the history is not deepened. Is the any specific reason for it or is it\n>> > a bug?\n>\n>> The above is not specific enough to judge if you found a bug or if it is a\n>> user error.\n>\n> To be more specific, the steps to reproduce:\n>\n> $ git clone --depth=1 git://git.kernel.org/pub/scm/git/git.git\n> $ cd git\n> $ git fetch --depth 2 --all\n>\n> and the last command does nothing, while\n>\n> $ git fetch --depth 2\n>\n> deepens the clone by 2 repos, as expected.\n>\n>> IIRC, --depth=<n> is not \"deepen by <n>\", but \"make sure I have at least\n>> <n> from the updated tip(s)\".  The shallow-clone hack gives you quite\n>> useless (even though it may be internally consistent) semantics if you\n>> shallow-cloned way in the past and fetched with --depth after the other\n>> side added many more commits than <n>, as you cannot guess what the right\n>> value of <n> should be without actually fetching without --depth.\n>\n> That is true. Also, from esthetic point of view, sometimes I miss the\n> functionality to deepen the full repository. For example git fetch\n> --depth 0 could do it. Now I have to do git fetch --depth\n> <very_large_number>\n>\n> --\n>  Kacper Kornet\n>\n"}]}