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

Re: [PATCH 3/3] {fetch,upload}-pack: allow --depth=0 to deepen into full repo again

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 20, 2010, 09:22 UTC
Message-ID
<201008201122.09392.jnareb@gmail.com>
In-Reply-To
<AANLkTinQZxpLdFiCFH3kDTFVQ-ZLjJ1PEdmmsJSb=0YD@mail.gmail.com>
On Fri, Aug 20, 2010, Nguyen Thai Ngoc Duy wrote:
Show 21 quoted lines
> On Fri, Aug 20, 2010 at 7:22 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>>
>>> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
>>> ---
>>>  The funny thing is, even with --depth=0, I still have two commit grafts
>>>  in $GIT_DIR/shallow, which are grafts of tags. I think there is a bug
>>> somewhere..
>>>
>>>  builtin/fetch-pack.c |    2 +-
>>>  shallow.c            |    2 +-
>>>  upload-pack.c        |    8 ++++----
>>>  3 files changed, 6 insertions(+), 6 deletions(-)
>>>
>>
>> Fist, it lacks documentation update that --depth=0 means infinite
>> depth (making repository not-shallow).
> 
> Yeah. I would do documentation and tests later once I figured out why
> --depth=0 did not give me full repo. It turns out I need --tags to
> (refetch?) tags and have full repo.

Perhaps --depth=0 should also work as if --tags were specified on command line? BTW. shouldn't git fetch tags that point to commits that got doenloaded because of deepening the clone?

Show 7 quoted lines
> 
>> Second, it would be nice (though probably not easy with parseopt, as
>> it would require hacks/extensions) to be able to use --depth=inf
>> (like wget supports '-l inf') to mean infinite depth...
> 
> Hmm.. make --depth a string parameter and fetch-pack should parse the
> parameter itself, like git-clone. Good idea.

If there were more options that use <n> == 0 to actually mean unlimited (infinity), perhaps it would be better to extend parseopt to provide for such situation, e.g. OPT_INT_INF or something. This way we would avoid code duplication.

... oh, wait, the newly introduced[1] git-merge `--log-limit' option uses --log-limit=0 to mean unlimited.

[1] http://permalink.gmane.org/gmane.comp.version-control.git/153984
    Message-ID: <20100820081641.GA32127@burratino>
    Subject: Re: wishlist bugreport: make limit configurable for do_fmt_merge_msg (merge.log)
-- 
Jakub Narebski
Poland
Previous: Nguyen Thai Ngoc DuyNext: Ramkumar Ramachandra
Message 12 of 16 in “fully deepening a shallow clone”
  1. Joey HessAug 17, 2010
  2. Nguyen Thai Ngoc DuyAug 18, 2010
  3. Daniel JohnsonAug 18, 2010
  4. 1/3 clone: do not accept --depth on local clonesNguyễn Thái Ngọc Duy, Aug 19, 2010
  5. Daniel JohnsonAug 19, 2010
  6. Nguyen Thai Ngoc DuyAug 19, 2010
  7. Mikael MagnussonAug 19, 2010
  8. 2/3 fetch-pack: use args.shallow to detect shallow clone instead of args.depthNguyễn Thái Ngọc Duy, Aug 19, 2010
  9. 3/3 {fetch,upload}-pack: allow --depth=0 to deepen into full repo againNguyễn Thái Ngọc Duy, Aug 19, 2010
  10. Jakub NarebskiAug 19, 2010
  11. Nguyen Thai Ngoc DuyAug 19, 2010
  12. Jakub NarebskiAug 20, 2010
  13. Ramkumar RamachandraAug 20, 2010
  14. grep -A/-B/-Cinfinity to get full contextJonathan Nieder, Aug 20, 2010
  15. Ramkumar RamachandraAug 20, 2010
  16. Joey HessAug 18, 2010

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.