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

[BUG] Amending a shallow clone -> orphan branch

From
AMAlexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Date
Aug 6, 2021, 00:04 UTC
Message-ID
<64760969-1ead-2bfb-6f98-1161d385c0ca@syntevo.com>
Consider the following steps :
git clone --depth 1 --single-branch --branch master 
https://github.com/git/git
cd git
 >1.txt
git add 1.txt
git commit --amend

This results in an orphaned branch, where a single commit contains entire tree.

I understand that this is a bug, because certainly git knew shallow commit's parents and could reuse that when amending?

Next: Bagas Sanjaya
Message 1 of 5 in “[BUG] Amending a shallow clone -> orphan branch”
  1. Alexandr MiloslavskiyAug 6, 2021
  2. Bagas SanjayaAug 6, 2021
  3. Alexandr MiloslavskiyAug 6, 2021
  4. Alexandr MiloslavskiyAug 6, 2021
  5. Alexandr MiloslavskiyAug 6, 2021

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.