{"thread":{"id":"16478","subject":"format-patch problem when using relative","startedAt":"2008-11-26T16:12:02Z","lastAt":"2008-11-27T09:42:58Z","messageCount":4,"participants":["Nikola Knežević","Jeff King","Björn Steinbrink"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96553","messageId":"17081052-4480-4971-9F38-BD5C48087379@gmail.com","threadId":"16478","inReplyTo":null,"subject":"format-patch problem when using relative","fromName":"Nikola Knežević","fromEmail":"laladelausanne@gmail.com","sentAt":"2008-11-26T16:12:02Z","receivedAt":"2008-11-26T16:12:02Z","isPatch":false,"sender":{"key":"laladelausanne@gmail.com","avatar":null},"body":"Hi,\n\nI have a subdirectory in my top-level directory, which I merged using  \nsubtree strategy. I want to send my patches upstream, so I did  \nsomething like:\ngit format-patch -o patches -n --relative=click click/master myclick\n\nThis produced a bunch of files in patches directory, most of which are  \nempty. When I tried this --stdout, I had something like this:\n[PATCH 8725/8846]\n[PATCH 8726/8846]\n[PATCH 8750/8846]\n..\n[PATCH 8845/8846]\n\nSo, it seems that format-patch was counting all patches, but only  \nprinting the interesting ones.\n\nI'm running git 1.6.0.1 on FreeBSD7/amd64.\n\nPS. Please CC me, since I'm not on the list.\n\nCheers,\nNikola\n"},{"id":"96564","messageId":"20081126180154.GA7584@coredump.intra.peff.net","threadId":"16478","inReplyTo":"17081052-4480-4971-9F38-BD5C48087379@gmail.com","subject":"Re: format-patch problem when using relative","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-11-26T18:01:54Z","receivedAt":"2008-11-26T18:01:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Nov 26, 2008 at 05:12:02PM +0100, Nikola Knežević wrote:\n\n> git format-patch -o patches -n --relative=click click/master myclick\n>\n> This produced a bunch of files in patches directory, most of which are  \n> empty. When I tried this --stdout, I had something like this:\n\nHmm. It seems that there is no history pruning done with --relative, so\nyou will still end up with commits that make no changes. However, this\nis intentional. See cd676a51:\n\n    diff --relative: output paths as relative to the current subdirectory\n    [...]\n     - This works not just with diff but also works with the log\n       family of commands, but the history pruning is not affected.\n\n       In other words, if you go to a subdirectory, you can say:\n\n            $ git log --relative -p\n\n       but it will show the log message even for commits that do not\n       touch the current directory.  You can limit it by giving\n       pathspec yourself:\n\n            $ git log --relative -p .\n\n       This originally was not a conscious design choice, but we\n       have a way to affect diff pathspec and pruning pathspec\n       independently.  IOW \"git log --full-diff -p .\" tells it to\n       prune history to commits that affect the current subdirectory\n       but show the changes with full context.  I think it makes\n       more sense to leave pruning independent from --relative than\n       the obvious alternative of always pruning with the current\n       subdirectory, which would break the symmetry.\n\nSo I think what you really want is:\n\n  git format-patch --relative=click click/master myclick -- click\n\nto limit the path pruning to the 'click' directory.\n\n-Peff\n"},{"id":"96568","messageId":"06D676E3-6C24-4ACC-9874-8B19549BC3A1@gmail.com","threadId":"16478","inReplyTo":"20081126180154.GA7584@coredump.intra.peff.net","subject":"Re: format-patch problem when using relative","fromName":"Nikola Knežević","fromEmail":"laladelausanne@gmail.com","sentAt":"2008-11-26T18:58:34Z","receivedAt":"2008-11-26T18:58:34Z","isPatch":false,"sender":{"key":"laladelausanne@gmail.com","avatar":null},"body":"On 26 Nov 2008, at 19:01 , Jeff King wrote:\n\n> So I think what you really want is:\n>\n>  git format-patch --relative=click click/master myclick -- click\n>\n> to limit the path pruning to the 'click' directory.\n\nYes, that did the trick. Also, when I think about it, it makes sense -  \ndo checks relative to a path, but prune using path.\n\nThanks,\nNikola\n"},{"id":"96614","messageId":"20081127094258.GA12018@atjola.homenet","threadId":"16478","inReplyTo":"06D676E3-6C24-4ACC-9874-8B19549BC3A1@gmail.com","subject":"Re: format-patch problem when using relative","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-11-27T09:42:58Z","receivedAt":"2008-11-27T09:42:58Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.11.26 19:58:34 +0100, Nikola Knežević wrote:\n> On 26 Nov 2008, at 19:01 , Jeff King wrote:\n>\n>> So I think what you really want is:\n>>\n>>  git format-patch --relative=click click/master myclick -- click\n>>\n>> to limit the path pruning to the 'click' directory.\n>\n> Yes, that did the trick. Also, when I think about it, it makes sense -  \n> do checks relative to a path, but prune using path.\n\nAh, now that makes sense to me, too. You just didn't use the actual\ncommand I told you on IRC ;-)\n\n<doener> git format-patch --relative=click/ click/master click\n\nThat already had the path limiting \"click\" in it, I really meant \"click\"\nthere, not \"myclick\" ;-) I guess the confusion was caused by how\nformat-patch takes the range it's supposed to work on. If you only give\nit a single committish, that is interpreted as \"since\". So the above is\nequal to\n\ngit format-patch --relative=click/ click/master..HEAD click\n\nBjörn\n"}]}