{"thread":{"id":"39528","subject":"format-patch and submodules","startedAt":"2015-06-04T23:20:20Z","lastAt":"2015-06-10T22:41:51Z","messageCount":5,"participants":["Christopher Dunn","Jens Lehmann","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"262984","messageId":"CAD2z=MAu1qrr9=wwBnOJZZ3JCJOsmFWi=gDgKMQKU3_P-01e3g@mail.gmail.com","threadId":"39528","inReplyTo":null,"subject":"format-patch and submodules","fromName":"Christopher Dunn","fromEmail":"cdunn2001@gmail.com","sentAt":"2015-06-04T23:20:20Z","receivedAt":"2015-06-04T23:20:20Z","isPatch":false,"sender":{"key":"cdunn2001@gmail.com","avatar":"https://gravatar.com/avatar/1803e3a9af5ed08696d894d6b86f45eaecb1c6564f055d3e79ba7337ecbcaf17?d=mp&s=160"},"body":"(Seen in git versions: 2.1.0 and 1.9.3 et al.)\n\n$ git format-patch --stdout X^..X | git apply check -\nfatal: unrecognized input\n\nThis fails when the commit consists of nothing but a submodule change\n(as in 'git add submodule foo'), but it passes when a file change is\nadded to the same commit.\n\nThere used to be a similar problem for empty commits, but that was\nfixed around git-1.8:\n\n    http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link\n\nNow, 'git format-patch' outputs nothing for an empty commit. I suppose\nthat needs to be the behavior also when only submodules are changed,\nsince in that case there is no 'diff' section from 'format-patch'.\n\nUse-case: git-p4\n\nOf course, we do not plan to add the submodule into Perforce, but we\nwould like this particular command to behave the same whether there\nare other diffs or not.\n\n~Christopher Dunn (cdunn2001)\n"},{"id":"263406","messageId":"557735E6.8040906@web.de","threadId":"39528","inReplyTo":"CAD2z=MAu1qrr9=wwBnOJZZ3JCJOsmFWi=gDgKMQKU3_P-01e3g@mail.gmail.com","subject":"Re: format-patch and submodules","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2015-06-09T18:52:22Z","receivedAt":"2015-06-09T18:52:22Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 05.06.2015 um 01:20 schrieb Christopher Dunn:\n> (Seen in git versions: 2.1.0 and 1.9.3 et al.)\n>\n> $ git format-patch --stdout X^..X | git apply check -\n> fatal: unrecognized input\n>\n> This fails when the commit consists of nothing but a submodule change\n> (as in 'git add submodule foo'), but it passes when a file change is\n> added to the same commit.\n>\n> There used to be a similar problem for empty commits, but that was\n> fixed around git-1.8:\n>\n>      http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link\n>\n> Now, 'git format-patch' outputs nothing for an empty commit. I suppose\n> that needs to be the behavior also when only submodules are changed,\n> since in that case there is no 'diff' section from 'format-patch'.\n>\n> Use-case: git-p4\n>\n> Of course, we do not plan to add the submodule into Perforce, but we\n> would like this particular command to behave the same whether there\n> are other diffs or not.\n\nHmm, I'm not sure that this is a bug. It looks to me like doing a\n\n$ git format-patch --stdout X^..X | git apply check -\n\nwhen nothing is changed except submodules and expecting it to work\nis the cause of the problem.\n\nI get the same error when I do:\n\n$git format-patch --stdout master..master | git apply --check -\nfatal: unrecognized input\n\nNo submodules involved, just an empty patch.\n\nI assume you want to ignore all submodule changes, so you should\ncheck if e.g. \"git diff --ignore-submodules X^..X\" returns anything\nbefore applying that? (From the command you ran I assume you might\nbe able to drop the --ignore-submodules because you already did set\n\"diff.ignoreSubmodules\" to \"all\"?)\n"},{"id":"263505","messageId":"CAD2z=MBSAzENvj1-WUMzrXznvudjCc3vyvYQQ+wMnPC3G3Go2Q@mail.gmail.com","threadId":"39528","inReplyTo":"557735E6.8040906@web.de","subject":"Re: format-patch and submodules","fromName":"Christopher Dunn","fromEmail":"cdunn2001@gmail.com","sentAt":"2015-06-10T17:04:03Z","receivedAt":"2015-06-10T17:04:03Z","isPatch":false,"sender":{"key":"cdunn2001@gmail.com","avatar":"https://gravatar.com/avatar/1803e3a9af5ed08696d894d6b86f45eaecb1c6564f055d3e79ba7337ecbcaf17?d=mp&s=160"},"body":"Sorry. I thought empty patches were made to work in other cases.\n\n'git-p4' needs to skip these. Wrong mailing list then.\n\nOn Tue, Jun 9, 2015 at 1:52 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 05.06.2015 um 01:20 schrieb Christopher Dunn:\n>>\n>> (Seen in git versions: 2.1.0 and 1.9.3 et al.)\n>>\n>> $ git format-patch --stdout X^..X | git apply check -\n>> fatal: unrecognized input\n>>\n>> This fails when the commit consists of nothing but a submodule change\n>> (as in 'git add submodule foo'), but it passes when a file change is\n>> added to the same commit.\n>>\n>> There used to be a similar problem for empty commits, but that was\n>> fixed around git-1.8:\n>>\n>>\n>> http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link\n>>\n>> Now, 'git format-patch' outputs nothing for an empty commit. I suppose\n>> that needs to be the behavior also when only submodules are changed,\n>> since in that case there is no 'diff' section from 'format-patch'.\n>>\n>> Use-case: git-p4\n>>\n>> Of course, we do not plan to add the submodule into Perforce, but we\n>> would like this particular command to behave the same whether there\n>> are other diffs or not.\n>\n>\n> Hmm, I'm not sure that this is a bug. It looks to me like doing a\n>\n> $ git format-patch --stdout X^..X | git apply check -\n>\n> when nothing is changed except submodules and expecting it to work\n> is the cause of the problem.\n>\n> I get the same error when I do:\n>\n> $git format-patch --stdout master..master | git apply --check -\n> fatal: unrecognized input\n>\n> No submodules involved, just an empty patch.\n>\n> I assume you want to ignore all submodule changes, so you should\n> check if e.g. \"git diff --ignore-submodules X^..X\" returns anything\n> before applying that? (From the command you ran I assume you might\n> be able to drop the --ignore-submodules because you already did set\n> \"diff.ignoreSubmodules\" to \"all\"?)\n"},{"id":"263533","messageId":"5578A8AC.2090704@diamand.org","threadId":"39528","inReplyTo":"CAD2z=MBSAzENvj1-WUMzrXznvudjCc3vyvYQQ+wMnPC3G3Go2Q@mail.gmail.com","subject":"Re: format-patch and submodules","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-06-10T21:14:20Z","receivedAt":"2015-06-10T21:14:20Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 10/06/15 18:04, Christopher Dunn wrote:\n> Sorry. I thought empty patches were made to work in other cases.\n>\n> 'git-p4' needs to skip these. Wrong mailing list then.\n\nPossibly the right mailing list - can you explain what you mean here \nw.r.t git-p4 please?\n\nThanks!\nLuke\n\n\n\n\n>\n> On Tue, Jun 9, 2015 at 1:52 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>> Am 05.06.2015 um 01:20 schrieb Christopher Dunn:\n>>>\n>>> (Seen in git versions: 2.1.0 and 1.9.3 et al.)\n>>>\n>>> $ git format-patch --stdout X^..X | git apply check -\n>>> fatal: unrecognized input\n>>>\n>>> This fails when the commit consists of nothing but a submodule change\n>>> (as in 'git add submodule foo'), but it passes when a file change is\n>>> added to the same commit.\n>>>\n>>> There used to be a similar problem for empty commits, but that was\n>>> fixed around git-1.8:\n>>>\n>>>\n>>> http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link\n>>>\n>>> Now, 'git format-patch' outputs nothing for an empty commit. I suppose\n>>> that needs to be the behavior also when only submodules are changed,\n>>> since in that case there is no 'diff' section from 'format-patch'.\n>>>\n>>> Use-case: git-p4\n>>>\n>>> Of course, we do not plan to add the submodule into Perforce, but we\n>>> would like this particular command to behave the same whether there\n>>> are other diffs or not.\n>>\n>>\n>> Hmm, I'm not sure that this is a bug. It looks to me like doing a\n>>\n>> $ git format-patch --stdout X^..X | git apply check -\n>>\n>> when nothing is changed except submodules and expecting it to work\n>> is the cause of the problem.\n>>\n>> I get the same error when I do:\n>>\n>> $git format-patch --stdout master..master | git apply --check -\n>> fatal: unrecognized input\n>>\n>> No submodules involved, just an empty patch.\n>>\n>> I assume you want to ignore all submodule changes, so you should\n>> check if e.g. \"git diff --ignore-submodules X^..X\" returns anything\n>> before applying that? (From the command you ran I assume you might\n>> be able to drop the --ignore-submodules because you already did set\n>> \"diff.ignoreSubmodules\" to \"all\"?)\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"263540","messageId":"CAD2z=MD3+63jL3Qqm-sj-7VnSB8ayhK_NjZV-qf+nyfuPdUk3Q@mail.gmail.com","threadId":"39528","inReplyTo":"5578A8AC.2090704@diamand.org","subject":"Re: format-patch and submodules","fromName":"Christopher Dunn","fromEmail":"cdunn2001@gmail.com","sentAt":"2015-06-10T22:41:51Z","receivedAt":"2015-06-10T22:41:51Z","isPatch":false,"sender":{"key":"cdunn2001@gmail.com","avatar":"https://gravatar.com/avatar/1803e3a9af5ed08696d894d6b86f45eaecb1c6564f055d3e79ba7337ecbcaf17?d=mp&s=160"},"body":"Well, now it gets more complicated. I want git-p4 to ignore submodules\ncompletely. But it fails only *only* the submodules changed. (At\nleast, my version fails. I'll try to diff against latest.)\n\nBut to debug this, I had to add a dry-run mode to git-p4. And I am\nusing a version of git-p4 which uses 'git-notes' rather than\nre-writing history. If you want, you can try my version:\n\n  https://github.com/pb-cdunn/git-p4\n\nOn Wed, Jun 10, 2015 at 4:14 PM, Luke Diamand <luke@diamand.org> wrote:\n> On 10/06/15 18:04, Christopher Dunn wrote:\n>>\n>> Sorry. I thought empty patches were made to work in other cases.\n>>\n>> 'git-p4' needs to skip these. Wrong mailing list then.\n>\n>\n> Possibly the right mailing list - can you explain what you mean here w.r.t\n> git-p4 please?\n>\n> Thanks!\n> Luke\n>\n>\n>\n>\n>>\n>> On Tue, Jun 9, 2015 at 1:52 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n>>>\n>>> Am 05.06.2015 um 01:20 schrieb Christopher Dunn:\n>>>>\n>>>>\n>>>> (Seen in git versions: 2.1.0 and 1.9.3 et al.)\n>>>>\n>>>> $ git format-patch --stdout X^..X | git apply check -\n>>>> fatal: unrecognized input\n>>>>\n>>>> This fails when the commit consists of nothing but a submodule change\n>>>> (as in 'git add submodule foo'), but it passes when a file change is\n>>>> added to the same commit.\n>>>>\n>>>> There used to be a similar problem for empty commits, but that was\n>>>> fixed around git-1.8:\n>>>>\n>>>>\n>>>>\n>>>> http://stackoverflow.com/questions/20775132/cannot-apply-git-patch-replacing-a-file-with-a-link\n>>>>\n>>>> Now, 'git format-patch' outputs nothing for an empty commit. I suppose\n>>>> that needs to be the behavior also when only submodules are changed,\n>>>> since in that case there is no 'diff' section from 'format-patch'.\n>>>>\n>>>> Use-case: git-p4\n>>>>\n>>>> Of course, we do not plan to add the submodule into Perforce, but we\n>>>> would like this particular command to behave the same whether there\n>>>> are other diffs or not.\n>>>\n>>>\n>>>\n>>> Hmm, I'm not sure that this is a bug. It looks to me like doing a\n>>>\n>>> $ git format-patch --stdout X^..X | git apply check -\n>>>\n>>> when nothing is changed except submodules and expecting it to work\n>>> is the cause of the problem.\n>>>\n>>> I get the same error when I do:\n>>>\n>>> $git format-patch --stdout master..master | git apply --check -\n>>> fatal: unrecognized input\n>>>\n>>> No submodules involved, just an empty patch.\n>>>\n>>> I assume you want to ignore all submodule changes, so you should\n>>> check if e.g. \"git diff --ignore-submodules X^..X\" returns anything\n>>> before applying that? (From the command you ran I assume you might\n>>> be able to drop the --ignore-submodules because you already did set\n>>> \"diff.ignoreSubmodules\" to \"all\"?)\n>>\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>\n>\n"}]}