* git fetch --all --depth @ 2011-07-20 22:39 Kacper Kornet 2011-07-21 16:36 ` Junio C Hamano 0 siblings, 1 reply; 4+ messages in thread From: Kacper Kornet @ 2011-07-20 22:39 UTC (permalink / raw) To: Git Mailing List Hi, 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? -- Kacper Kornet ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git fetch --all --depth 2011-07-20 22:39 git fetch --all --depth Kacper Kornet @ 2011-07-21 16:36 ` Junio C Hamano 2011-07-21 20:04 ` Kacper Kornet 0 siblings, 1 reply; 4+ messages in thread From: Junio C Hamano @ 2011-07-21 16:36 UTC (permalink / raw) To: Kacper Kornet; +Cc: Alex Neronskiy, Git Mailing List 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. 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git fetch --all --depth 2011-07-21 16:36 ` Junio C Hamano @ 2011-07-21 20:04 ` Kacper Kornet 2011-07-21 20:40 ` ZAK Magnus 0 siblings, 1 reply; 4+ messages in thread From: Kacper Kornet @ 2011-07-21 20:04 UTC (permalink / raw) To: Junio C Hamano; +Cc: Alex Neronskiy, Git Mailing List 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. > 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git fetch --all --depth 2011-07-21 20:04 ` Kacper Kornet @ 2011-07-21 20:40 ` ZAK Magnus 0 siblings, 0 replies; 4+ messages in thread From: ZAK Magnus @ 2011-07-21 20:40 UTC (permalink / raw) To: Kacper Kornet; +Cc: Junio C Hamano, Git Mailing List Looks like a bug. I believe the culprit is add_options_to_argv(), which is used by fetch_multiple() to copy command line arguments to a child process, but does not copy the --depth argument. Thus --all (and everything else that relies on fetch_multiple() or add_options_to_argv()) ignores --depth. On Thu, Jul 21, 2011 at 1:04 PM, Kacper Kornet <kornet@camk.edu.pl> wrote: > 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. > >> 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 > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-21 20:41 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-07-20 22:39 git fetch --all --depth Kacper Kornet 2011-07-21 16:36 ` Junio C Hamano 2011-07-21 20:04 ` Kacper Kornet 2011-07-21 20:40 ` ZAK Magnus
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).