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

Re: [PATCH v3 2/3] sha1dc: optionally use sha1collisiondetection as a submodule

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 5, 2017, 18:03 UTC
Message-ID
<87bmoybw2q.fsf@gmail.com>
In-Reply-To
<CAGZ79kaHLi7iotAT-eKkFv5fsG1fTA2k4SYZAPAmU7h3uAA8Jw@mail.gmail.com>
On Wed, Jul 05 2017, Stefan Beller jotted:
Show 60 quoted lines
> On Tue, Jul 4, 2017 at 6:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Stefan Beller <sbeller@google.com> writes:
>>
>>> On Tue, Jul 4, 2017 at 3:50 PM, Ævar Arnfjörð Bjarmason
>>> <avarab@gmail.com> wrote:
>>>
>>>>
>>>> I think some invocation of "git submodule update ???" will do the same,
>>>> but I can't from the docs see what that is right now.
>>>
>>> '--remote' is what you are looking for.
>>>
>>> When we have the branch field configured, the workflow for *creating*
>>> the patch sent
>>> to Junio might be different than it currently is. Currently, you would
>>> send a patch that is
>>> produced as:
>>>
>>>   git -C sha1collisiondetection pull origin master
>>>   git add sha1collisiondetection
>>>   git commit -m "serious reasoning in the commit message"
>>>
>>> This could be 'simplified' to
>>>
>>>   git submodule update --remote
>>>   git add sha1collisiondetection
>>>   git commit -m "serious reasoning in the commit message"
>>>
>>> but as we had different branches in the submodule field,
>>> I wonder how much of an ease this is.
>>>
>>> For Junio the workflow stays the same, as he would just
>>> apply the patch, so I understand why he might see the
>>> branch field as pollution.
>>
>> My reaction was more about "the rest of us", not me or those who
>> choose to bind a new/different commit in the submodule to the
>> superproject.
>
> Currently the rest of us would not care IMHO, as there is no
> difference with the field recorded or not. (I just checked if it
> would provide slight benefits for shallow clones, but not so)
>
>> I was recalling a wish by submodule users in a distant past that
>> lets "submodule update" to detach to the tip of the named branch in
>> the submodule, regardless of what commit the superproject points at
>> with its gitlink.
>
> Yes, I heard that a couple times when poking around for opinions
> and I think the issue has 2 facets:
> * They actually want to be on a branch, such that the workflow
>   is 'normal'. (Whatever that means, "detached HEAD" sounds
>   scary, but workflow-wise it is not. It just requires an additional
>   "checkout -b" once the work done seems worth preserving)
> * None of the people I talked to wanted to get rid of exact-tracking,
>   solely. But they always came in trade off with the first point
>   outweighing the benefits of exact tracking.
>   Although for this purpose the "update --remote" also doesn't
>   quite fit as it does not re-attach the HEAD to a branch at
>   the same commit as the remote tracking branch.

For my submodule use, I'd like to have it checkout the branchname recorded in the .gitmodules with tracking info set to upstream, and then "git reset --hard" to the commit that's recorded in the commit info.

This would exactly mirror the state the repo was in when I initally ran "git submodule add" on it, and make it easy to start making new commits on my local branch, submit a PR of those to upstream, and have things like "git fetch && git log @{u}.." work.

Show 7 quoted lines
>> When those merely following along with this project did "pull &&
>> submodule update", I do not want the submodule directory to check
>> out the commit that happens to be at the tip of their 'master'
>> branch.  If "submodule update" requires an explicit "--remote"
>> option to work in that way, then my worry is allayed, greatly.
>>
>> Thanks.
Previous: Stefan BellerNext: Ævar Arnfjörð Bjarmason
Message 36 of 50 in “Compile Error v2.13.2 on Solaris SPARC”
  1. Michael KebeJun 26, 2017
  2. 0/3 update sha1dc from PR #36Ævar Arnfjörð Bjarmason, Jun 27, 2017
  3. 1/3 sha1dc: update from my PR #36Ævar Arnfjörð Bjarmason, Jun 27, 2017
  4. Junio C HamanoJun 27, 2017
  5. Junio C HamanoJun 27, 2017
  6. Ævar Arnfjörð BjarmasonJun 27, 2017
  7. Junio C HamanoJun 27, 2017
  8. Liam R. HowlettJun 27, 2017
  9. Ævar Arnfjörð BjarmasonJun 27, 2017
  10. Junio C HamanoJun 27, 2017
  11. Junio C HamanoJun 27, 2017
  12. Ævar Arnfjörð BjarmasonJun 27, 2017
  13. Junio C HamanoJun 27, 2017
  14. Liam R. HowlettJun 27, 2017
  15. Junio C HamanoJun 27, 2017
  16. Ævar Arnfjörð BjarmasonJun 27, 2017
  17. Junio C HamanoJun 27, 2017
  18. Ævar Arnfjörð BjarmasonJun 27, 2017
  19. Junio C HamanoJun 27, 2017
  20. Junio C HamanoJun 27, 2017
  21. Ævar Arnfjörð BjarmasonJun 27, 2017
  22. 2/3 sha1dc: optionally use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, Jun 27, 2017
  23. Stefan BellerJun 27, 2017
  24. Ævar Arnfjörð BjarmasonJun 27, 2017
  25. 3/3 sha1collisiondetection: automatically enable when submodule is populatedÆvar Arnfjörð Bjarmason, Jun 27, 2017
  26. Stefan BellerJun 27, 2017
  27. 0/3 Update sha1dc from upstreamÆvar Arnfjörð Bjarmason, Jul 1, 2017
  28. 2/3 sha1dc: optionally use sha1collisiondetection as a submoduleÆvar Arnfjörð Bjarmason, Jul 1, 2017
  29. Junio C HamanoJul 3, 2017
  30. Ævar Arnfjörð BjarmasonJul 3, 2017
  31. Junio C HamanoJul 4, 2017
  32. Ævar Arnfjörð BjarmasonJul 4, 2017
  33. Stefan BellerJul 5, 2017
  34. Junio C HamanoJul 5, 2017
  35. Stefan BellerJul 5, 2017
  36. Ævar Arnfjörð BjarmasonJul 5, 2017
  37. 1/3 sha1dc: update from upstreamÆvar Arnfjörð Bjarmason, Jul 1, 2017
  38. 3/3 sha1collisiondetection: automatically enable when submodule is populatedÆvar Arnfjörð Bjarmason, Jul 1, 2017
  39. Michael KebeJun 26, 2017
  40. Ævar Arnfjörð BjarmasonJun 26, 2017
  41. Michael KebeJun 26, 2017
  42. Ævar Arnfjörð BjarmasonJun 26, 2017
  43. Liam R. HowlettJun 26, 2017
  44. Michael KebeJun 27, 2017
  45. Michael KebeJun 27, 2017
  46. Liam R. HowlettJun 27, 2017
  47. Junio C HamanoJun 27, 2017
  48. Liam R. HowlettJun 27, 2017
  49. Ævar Arnfjörð BjarmasonJun 27, 2017
  50. Ævar Arnfjörð BjarmasonJun 27, 2017

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.