{"thread":{"id":"23815","subject":"[PATCH] Add git format-patch produced patches to .gitignore","startedAt":"2010-05-15T21:22:46Z","lastAt":"2010-05-17T07:52:33Z","messageCount":9,"participants":["Ævar Arnfjörð Bjarmason","Pavan Kumar Sunkara","Jonathan Nieder","Michael J Gruber"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"141746","messageId":"1273958566-7328-1-git-send-email-avarab@gmail.com","threadId":"23815","inReplyTo":null,"subject":"[PATCH] Add git format-patch produced patches to .gitignore","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-15T21:22:46Z","receivedAt":"2010-05-15T21:22:46Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change Git's own .gitignore so that patches produced with git\nformat-patch don't show up as untracked.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n .gitignore |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/.gitignore b/.gitignore\nindex dbf1b90..039d99c 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -203,3 +203,4 @@\n *.pdb\n /Debug/\n /Release/\n+[0-9][0-9][0-9][0-9]-*.patch\n-- \n1.7.1.84.gd92f8\n"},{"id":"141758","messageId":"AANLkTinSJTzYOk_MRp2ddlLnbd5dC65q-c4zQbv8Oubj@mail.gmail.com","threadId":"23815","inReplyTo":"1273958566-7328-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Pavan Kumar Sunkara","fromEmail":"pavan.sss1991@gmail.com","sentAt":"2010-05-16T06:27:05Z","receivedAt":"2010-05-16T06:27:05Z","isPatch":true,"sender":{"key":"pavan.sss1991@gmail.com","avatar":"https://avatars.githubusercontent.com/u/174703?v=4"},"body":"Generally I use the format-patch command as:\n\ngit format-patch -M origin/master -o outgoing/\n\nSo, my patches will be in subdirectory outgoing.\nBut the regex rule in this patch won't be able to hide them.\n\nWhat do u want to do in that case ?\n\n- Pavan\n\nOn Sun, May 16, 2010 at 2:52 AM, Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> Change Git's own .gitignore so that patches produced with git\n> format-patch don't show up as untracked.\n>\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  .gitignore |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/.gitignore b/.gitignore\n> index dbf1b90..039d99c 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -203,3 +203,4 @@\n>  *.pdb\n>  /Debug/\n>  /Release/\n> +[0-9][0-9][0-9][0-9]-*.patch\n> --\n> 1.7.1.84.gd92f8\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"},{"id":"141759","messageId":"20100516075244.GA9010@progeny.tock","threadId":"23815","inReplyTo":"AANLkTinSJTzYOk_MRp2ddlLnbd5dC65q-c4zQbv8Oubj@mail.gmail.com","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-16T07:52:45Z","receivedAt":"2010-05-16T07:52:45Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Pavan Kumar Sunkara wrote:\n> Ævar Arnfjörð Bjarmason wrote:\n\n>> --- a/.gitignore\n>> +++ b/.gitignore\n>> @@ -203,3 +203,4 @@\n>>  *.pdb\n>>  /Debug/\n>>  /Release/\n>> +[0-9][0-9][0-9][0-9]-*.patch\n[...]\n> git format-patch -M origin/master -o outgoing/\n> \n> So, my patches will be in subdirectory outgoing.\n> But the regex rule in this patch won't be able to hide them.\n> \n> What do u want to do in that case ?\n\nTry it out.\n\nIn fact, I was worried that this patch would trigger a similar\nproblem: maybe some test data directory contains format-patch\noutput?  In fact none do, so I like the patch.\n\nThanks,\nJonathan\n"},{"id":"141768","messageId":"AANLkTilsZ1Dzsu6GwWaNh8WvMrzpQtj5AQNDavdYuCjf@mail.gmail.com","threadId":"23815","inReplyTo":"20100516075244.GA9010@progeny.tock","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-16T13:06:25Z","receivedAt":"2010-05-16T13:06:25Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, May 16, 2010 at 07:52, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Pavan Kumar Sunkara wrote:\n>> Ævar Arnfjörð Bjarmason wrote:\n>\n>>> --- a/.gitignore\n>>> +++ b/.gitignore\n>>> @@ -203,3 +203,4 @@\n>>>  *.pdb\n>>>  /Debug/\n>>>  /Release/\n>>> +[0-9][0-9][0-9][0-9]-*.patch\n> [...]\n>> git format-patch -M origin/master -o outgoing/\n>>\n>> So, my patches will be in subdirectory outgoing.\n>> But the regex rule in this patch won't be able to hide them.\n>>\n>> What do u want to do in that case ?\n>\n> Try it out.\n\nRight, patches in outgoing/ will be ignored too because the rule isn't\nprefixed with /, so it works regardless of whether the file is in a\nsubdirectory or not.\n\n> In fact, I was worried that this patch would trigger a similar\n> problem: maybe some test data directory contains format-patch\n> output?  In fact none do, so I like the patch.\n\nNone do, there's no file that matches '????-*.patch' in Git. Even if\nthere was you could still 'git add -f' it, which wouldn't be that big\nof a problem because it would be part of some rarely touched test\nsuite in t/*.\n"},{"id":"141773","messageId":"4BEFFBB5.7010808@drmicha.warpmail.net","threadId":"23815","inReplyTo":"1273958566-7328-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-16T14:05:41Z","receivedAt":"2010-05-16T14:05:41Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Ævar Arnfjörð Bjarmason venit, vidit, dixit 15.05.2010 23:22:\n> Change Git's own .gitignore so that patches produced with git\n> format-patch don't show up as untracked.\n> \n\nDoes the git build process call format-patch? No! The .gitignore we\ndistribute is meant for things the build process creates, not for\nimposing a specific workflow on developers.\n\nIf you want to ignore format patch output, simply use .git/info/excludes\nor a global excludes file, but please don't force everyone else to live\nwith that or work around it.\n\nCheers,\nMichael\n\n> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n> ---\n>  .gitignore |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/.gitignore b/.gitignore\n> index dbf1b90..039d99c 100644\n> --- a/.gitignore\n> +++ b/.gitignore\n> @@ -203,3 +203,4 @@\n>  *.pdb\n>  /Debug/\n>  /Release/\n> +[0-9][0-9][0-9][0-9]-*.patch\n"},{"id":"141784","messageId":"20100517013549.GA19081@progeny.tock","threadId":"23815","inReplyTo":"4BEFFBB5.7010808@drmicha.warpmail.net","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-17T01:35:49Z","receivedAt":"2010-05-17T01:35:49Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Michael J Gruber wrote:\n\n> Does the git build process call format-patch? No! The .gitignore we\n> distribute is meant for things the build process creates\n\nAh, true.  I seem to remember a thread long ago about whether to\ninclude editor droppings in .gitignore, but I can’t find it in\nthe git or lkml archive.\n\ngit’s .gitignore does not include .*.swp, \\#*#, *~, indeed.\n\n>> +[0-9][0-9][0-9][0-9]-*.patch\n\nSo nack from me as well.  It is nice that the .gitignore file we track\ndoes not have to change with fashions, and this way each user can set\nup a personal excludesfile according to choice of tools without\ninterference.\n\nMaybe there should be a reasonable \"default\" .gitexcludes file in\ngitignore.5 as an example, but that is a different topic[1].\n\nThanks for the reminder,\nJonathan\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/96220/focus=96289\n"},{"id":"141785","messageId":"1274061883-18043-1-git-send-email-avarab@gmail.com","threadId":"23815","inReplyTo":"20100517013549.GA19081@progeny.tock","subject":"[PATCH] Remove editor-specific droppings from .gitignore","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-05-17T02:04:43Z","receivedAt":"2010-05-17T02:04:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Git's own .gitignore files should only contain things created by Git's\nbuild systems, not editor-specific droppings.\n\nSee the discussion following the \"[PATCH] Add git format-patch\nproduced patches to .gitignore\" thread\n(<1273958566-7328-1-git-send-email-avarab@gmail.com>).\n---\n\nOn Mon, May 17, 2010 at 01:35, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Michael J Gruber wrote:\n>\n>> Does the git build process call format-patch? No! The .gitignore we\n>> distribute is meant for things the build process creates\n>\n> Ah, true. I seem to remember a thread long ago about whether to\n> include editor droppings in .gitignore, but I canât find it in\n> the git or lkml archive.\n>\n> gitâs .gitignore does not include .*.swp, \\#*#, *~, indeed.\n\nThanks both of you, I stand corrected. Anyway, I guess this is a bug\nthen. It's the only thing ignored by Git's various .gitignore files\nthat isn't created by the build system.\n\n git-gui/po/.gitignore |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/git-gui/po/.gitignore b/git-gui/po/.gitignore\nindex a89cf44..e358dd1 100644\n--- a/git-gui/po/.gitignore\n+++ b/git-gui/po/.gitignore\n@@ -1,2 +1 @@\n *.msg\n-*~\n-- \n1.7.1.84.gd92f8\n"},{"id":"141786","messageId":"20100517022244.GA19141@progeny.tock","threadId":"23815","inReplyTo":"4BEFFBB5.7010808@drmicha.warpmail.net","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-05-17T02:22:44Z","receivedAt":"2010-05-17T02:22:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Michael J Gruber wrote:\n\n> If you want to ignore format patch output, simply use .git/info/excludes\n> or a global excludes file, but please don't force everyone else to live\n> with that or work around it.\n\nSide note: I said with similar intent that this allows developers to\nwork “without interference”.  This was a poor choice of words on my\npart: a too-long .gitignore only prevents me from noticing and\ntracking files that others considered not worth tracking.\n\nFrom the thread I faintly remembered and then linked to[1]: ;-)\n\n  I earlier said that \"*~\" should not be in project-wide .gitignore\n  file because use of Emacs vs vi is a matter of personal taste, and\n  Emacs specific \"*~\" pattern does not belong to a project policy,\n  just like vim \"*.swp\" pattern doesn't.\n\n  But I think that reasoning is flawed.  The right criteria should not\n  be about \"use of Emacs vs vi\", but about \"do we in this project ever\n  want to track files that match *~ or *.swp as legitimate contents\".\n  If a project expects not to have a tracked file whose name ends with\n  \".swp\", even if it does _not_ mean to encourage use of vim over\n  Emacs or any other editor, I think it is fine to add such to its\n  tracked .gitignore file for its developer's benefit.\n\nThis does not change my conclusion: there are many other reasons to\nleave files produced outside the build process unlisted:\n\n . consistency: to keep the file intuitive and avoid a lot of\n   patch churn, it is nicest to choose one rule and stick to it\n\n . simplicity: shorter .gitignore.  Making the appropriate content\n   of .gitignore depend on the behavior of too many text editors\n   (and IDEs, and foreign VCSes, and debugging tools, and ...)\n   makes it hard to maintain.  See qt’s .gitignore for an example\n   of this.\n\n . correctness: for the case of format-patch, it is hard to say\n   \"we will never want to track files that match ????-*.patch as\n   legitimate contents\".  In fact, it is likely such files may need\n   to be added to the test suite.\n\nAnd unlike .o files and company, it does not seem likely that\nformatted patches need to be kept around during development.\n\nI hope that is a little clearer.  Sorry for the ramble.\nJonathan\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/96220/focus=96294\n"},{"id":"141795","messageId":"4BF0F5C1.1060309@drmicha.warpmail.net","threadId":"23815","inReplyTo":"20100517022244.GA19141@progeny.tock","subject":"Re: [PATCH] Add git format-patch produced patches to .gitignore","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-17T07:52:33Z","receivedAt":"2010-05-17T07:52:33Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jonathan Nieder venit, vidit, dixit 17.05.2010 04:22:\n> Michael J Gruber wrote:\n> \n>> If you want to ignore format patch output, simply use .git/info/excludes\n>> or a global excludes file, but please don't force everyone else to live\n>> with that or work around it.\n> \n> Side note: I said with similar intent that this allows developers to\n> work “without interference”.  This was a poor choice of words on my\n> part: a too-long .gitignore only prevents me from noticing and\n> tracking files that others considered not worth tracking.\n> \n> From the thread I faintly remembered and then linked to[1]: ;-)\n> \n>   I earlier said that \"*~\" should not be in project-wide .gitignore\n>   file because use of Emacs vs vi is a matter of personal taste, and\n>   Emacs specific \"*~\" pattern does not belong to a project policy,\n>   just like vim \"*.swp\" pattern doesn't.\n> \n>   But I think that reasoning is flawed.  The right criteria should not\n>   be about \"use of Emacs vs vi\", but about \"do we in this project ever\n>   want to track files that match *~ or *.swp as legitimate contents\".\n>   If a project expects not to have a tracked file whose name ends with\n>   \".swp\", even if it does _not_ mean to encourage use of vim over\n>   Emacs or any other editor, I think it is fine to add such to its\n>   tracked .gitignore file for its developer's benefit.\n\nI think I meant to object back then but concluded it made no difference.\nMy mathematically deformed^Weducated mind tells me that \"do we...\ncontents\" means we should put everything in .gitignore except what we\nexpect to track. So, here the literal understanding certainly differs\nfrom the intended definition ;)\n\n> \n> This does not change my conclusion: there are many other reasons to\n> leave files produced outside the build process unlisted:\n> \n>  . consistency: to keep the file intuitive and avoid a lot of\n>    patch churn, it is nicest to choose one rule and stick to it\n> \n>  . simplicity: shorter .gitignore.  Making the appropriate content\n>    of .gitignore depend on the behavior of too many text editors\n>    (and IDEs, and foreign VCSes, and debugging tools, and ...)\n>    makes it hard to maintain.  See qt’s .gitignore for an example\n>    of this.\n> \n>  . correctness: for the case of format-patch, it is hard to say\n>    \"we will never want to track files that match ????-*.patch as\n>    legitimate contents\".  In fact, it is likely such files may need\n>    to be added to the test suite.\n> \n> And unlike .o files and company, it does not seem likely that\n> formatted patches need to be kept around during development.\n> \n> I hope that is a little clearer.  Sorry for the ramble.\n> Jonathan\n\nI haven't found the rambling part in your post yet but agree everything\nis clearer now :)\n\nMichael\n\nP.S.: I'm fine with Ævar's revised patch, of course. ACK\n> \n> [1] http://thread.gmane.org/gmane.comp.version-control.git/96220/focus=96294\n"}]}