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

Re: What's cooking in git.git (Jul 2017, #01; Wed, 5)

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 7, 2017, 02:13 UTC
Message-ID
<xmqqbmoxdmea.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kamhPAQrE3GBC=fG=PNNtdHj7iStsqjOojkVMpNy_VEWw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> Speaking of submodules, It's not just features, but I also send bug fixes. ;)
> https://public-inbox.org/git/20170630003851.17288-1-sbeller@google.com/
> (That patch is not related to this series, except for working in the submodule
> area, but I consider that patch more important than e.g. this series.)
I did not see the patch as fixing a bug, though.  

I do agree that overwriting the branch tips in the submodule repositories, possibly rewinding and discarding user's work done on the local branches, is indeed a problem. It however is unclear why detaching HEAD is a good solution to solve that problem.

After all, there must have been a reason why the user had checked out a branch and had pointed it at a specific commit (presumably, so that further work would be done while on the branch, to make it easier and safer to eventually push the result back to the upstream of the submodule's project). So another solution that seems equally viable, if not even more so, could be to fail the recursive checkout saying why the checkout cannot be done, just like we fail a checkout when a local change interferes with updating the contents in the working tree and the index with an error message explaining which paths are problematic.

I am *not* saying which one among the above two is better; I am not even saying that there could be only these two possible solutions. I just found the posted patch unsatisfactory because it did not make it clear why the chosen solution is a good one.

Perhaps I misread the description; but that would mean the description was prone to be misread and has room for improvement ;-)

Previous: Stefan BellerNext: Stefan Beller
Message 3 of 14 in “What's cooking in git.git (Jul 2017, #01; Wed, 5)”
  1. Junio C HamanoJul 5, 2017
  2. Stefan BellerJul 5, 2017
  3. Junio C HamanoJul 7, 2017
  4. Stefan BellerJul 10, 2017
  5. 0/3 branch: add a --copy to go with --moveÆvar Arnfjörð Bjarmason, Jul 5, 2017
  6. 1/3 config: create a function to format section headersÆvar Arnfjörð Bjarmason, Jul 5, 2017
  7. 2/3 branch: add test for -m renaming multiple config sectionsÆvar Arnfjörð Bjarmason, Jul 5, 2017
  8. 3/3 branch: add a --copy (-c) option to go with --move (-m)Ævar Arnfjörð Bjarmason, Jul 5, 2017
  9. Junio C HamanoJul 6, 2017
  10. 4/3 branch: fix "copy" to never touch HEADJunio C Hamano, Sep 22, 2017
  11. Brandon WilliamsSep 22, 2017
  12. Ævar Arnfjörð BjarmasonSep 26, 2017
  13. Junio C HamanoSep 27, 2017
  14. Ævar Arnfjörð BjarmasonSep 29, 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.