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

Re: [PATCHv5] clone --single: limit the fetch refspec to fetched branch

From
Ralf Thielow <ralf.thielow@gmail.com>
Date
Sep 17, 2012, 21:04 UTC
Message-ID
<CAN0XMOKCsjfG-DgV_rr99mYXHBSKryL1O46X+7r5ie+=2aKmmA@mail.gmail.com>
In-Reply-To
<7v8vc8v1wd.fsf@alter.siamese.dyndns.org>
On Mon, Sep 17, 2012 at 10:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Ralf Thielow <ralf.thielow@gmail.com> writes:
>
>> - handle --mirror option (test added)
>
> Handle how?  I personally think erroring out is the right way to
> handle it, but if we care about people who have been misusing the
> combination of single and mirror, the second best way would be to
> imply "mirror" and "single" combination as "bare" and "single"
> without "mirror".
>

With this patch it would be "bare" and "single", and with the next fetch a "mirror". However, the combination of "single" and "mirror" doesn't really make sense so I also think we should error it out.

Show 8 quoted lines
>> - install correct refspec if the value of --branch is a tag (test added)
>
> What is the definition of "correct"?  I see the documentation says
> "--branch can also take tags and treat them like detached HEAD", and
> even though I _think_ allowing tags was a huge mistake, if we claim
> we treat it like detached HEAD, we should do the same when coming up
> with the refspec used for the follow-up "fetch".
>

This patch would install the refspec "+refs/tags/v1.7.10:refs/tags/v1.7.10", so we would do the same with the follow-up "fetch", not? This can be seen as "it's not a bug, it's a feature". Why not cloning a tag of a repo if someone just want to build a tag without having anything else.

Show 5 quoted lines
> Whatever we decide to do, the semantics we decided to use at least
> need to be described in the commit log message, not just in the
> "changes from the previous iteration".  Updating the
> "Documentation/git-clone.txt" would also be necessary.
>
Ok.
Show 13 quoted lines
>> +test_expect_success 'refspec contains all branches by default' '
>> +     echo "+refs/heads/*:refs/remotes/origin/*" > expect &&
>> +     git --git-dir=dir_all/.git config --get remote.origin.fetch > actual &&
>> +     test_cmp expect actual
>> +'
>
> I still think these checks that know the current implementation
> details (i.e. what exact configuration variables get what exact
> values) are wrong thing to have in the longer term.  If the desired
> behaviour (i.e. "later fetch do not screw up") can be tested
> directly like the later parts of the test in this patch does, how
> that desired behaviour is implemented should not have to be cast in
> stone with these tests.
You wrote
> I'll let it pass for now, though.
so I haven't removed them yet. I'll delete them.
Previous: Junio C HamanoNext: Junio C Hamano
Message 20 of 39 in “is this behaviour expected for "git clone --single-branch"?”
  1. Ralf ThielowSep 13, 2012
  2. Junio C HamanoSep 13, 2012
  3. Ralf ThielowSep 13, 2012
  4. clone: fix refspec on "--single-branch" optionRalf Thielow, Sep 14, 2012
  5. Junio C HamanoSep 14, 2012
  6. Junio C HamanoSep 14, 2012
  7. Nguyen Thai Ngoc DuySep 14, 2012
  8. Ralf ThielowSep 14, 2012
  9. Junio C HamanoSep 14, 2012
  10. [PATCHv2] clone: fix refspec on "--single-branch" optionRalf Thielow, Sep 14, 2012
  11. Junio C HamanoSep 14, 2012
  12. [PATCHv3] clone: fix refspec on "--single-branch" optionRalf Thielow, Sep 14, 2012
  13. Junio C HamanoSep 14, 2012
  14. [PATCHv4] clone --single: limit the fetch refspec to fetched branchRalf Thielow, Sep 16, 2012
  15. Junio C HamanoSep 17, 2012
  16. Nguyen Thai Ngoc DuySep 17, 2012
  17. Nguyen Thai Ngoc DuySep 17, 2012
  18. [PATCHv5] clone --single: limit the fetch refspec to fetched branchRalf Thielow, Sep 17, 2012
  19. Junio C HamanoSep 17, 2012
  20. Ralf ThielowSep 17, 2012
  21. Junio C HamanoSep 17, 2012
  22. Ralf ThielowSep 18, 2012
  23. Junio C HamanoSep 18, 2012
  24. [PATCHv6] clone --single: limit the fetch refspec to fetched branchRalf Thielow, Sep 18, 2012
  25. Junio C HamanoSep 18, 2012
  26. Junio C HamanoSep 18, 2012
  27. [PATCHv7] clone --single: limit the fetch refspec to fetched branchRalf Thielow, Sep 19, 2012
  28. Junio C HamanoSep 19, 2012
  29. [PATCHv8] clone --single: limit the fetch refspec to fetched branchRalf Thielow, Sep 20, 2012
  30. Junio C HamanoSep 20, 2012
  31. Nguyen Thai Ngoc DuySep 19, 2012
  32. Ralf ThielowSep 19, 2012
  33. Junio C HamanoSep 17, 2012
  34. Nguyen Thai Ngoc DuySep 18, 2012
  35. Junio C HamanoSep 18, 2012
  36. Ralf ThielowSep 17, 2012
  37. Junio C HamanoSep 17, 2012
  38. Nguyen Thai Ngoc DuySep 18, 2012
  39. Junio C HamanoSep 14, 2012

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.