{"thread":{"id":"59947","subject":"Bug report: AM 3-way patching fails with partial cloning","startedAt":"2023-07-03T16:46:59Z","lastAt":"2023-07-04T22:03:08Z","messageCount":2,"participants":["Marius Schiffer","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"479139","messageId":"1e79047e-944c-0112-ffd0-ca52e31226c3@mschiffer.de","threadId":"59947","inReplyTo":null,"subject":"Bug report: AM 3-way patching fails with partial cloning","fromName":"Marius Schiffer","fromEmail":"marius@mschiffer.de","sentAt":"2023-07-03T16:46:45Z","receivedAt":"2023-07-03T16:46:59Z","isPatch":false,"sender":{"key":"marius@mschiffer.de","avatar":null},"body":"When applying patches with git am on a repository cloned with \nfilter=blob:none, the patching sometimes fails when it can't find the \nrequired SHA1 information.\nApplying the same thing on a normal clone works.\nI'm not sure yet what exactly i s missing that is not fetched, but I \nguess git should be able to fetch the missing blobs. I would also be \nvery happy to hear workarounds, as I really love git partial cloning.\n\nUsing git v2.41.0.\n\nTo reproduce:\n\n1. Download this patch: \nhttps://raw.githubusercontent.com/projectceladon/vendor-intel-utils/master/bsp_diff/common/kernel/linux-intel-lts2021/0007-9p-freezing-aborts-when-use-wait_event_killable.patch\n\n2. Clone this repository: git clone --filter=blob:none \nhttps://github.com/projectceladon/linux-intel-lts2021\n\n3. Apply the patch: git am -3 \n../0007-9p-freezing-aborts-when-use-wait_event_killable.patch\n\n\n--\nMarius\n\n\n"},{"id":"479176","messageId":"xmqqedln49nz.fsf@gitster.g","threadId":"59947","inReplyTo":"1e79047e-944c-0112-ffd0-ca52e31226c3@mschiffer.de","subject":"Re: Bug report: AM 3-way patching fails with partial cloning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-07-04T22:02:56Z","receivedAt":"2023-07-04T22:03:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marius Schiffer <marius@mschiffer.de> writes:\n\n> When applying patches with git am on a repository cloned with\n> filter=blob:none, the patching sometimes fails when it can't find the\n> required SHA1 information.\n> Applying the same thing on a normal clone works.\n\nThis is very much expected, especially if your patches are not\ngenerated with --full-index option, because partial clones cannot\non-demand request objects without knowing their full object names to\nthe promissor remote.  I do not offhand know if \"am -3\" codepath, if\nthe full object name is available, is arranged to trigger lazy\nfetching of the objects, but nobody sane are sending patches with\nthe --full-index option to begin with, so that is academic, I would\nsay.\n"}]}