git-format-patch with -o ../ in subdir of working copy writes output in wrong place
From: Cesar Eduardo Barros <hidden>
Date: 2016-06-15 22:45:56
From: Cesar Eduardo Barros <hidden>
Date: 2016-06-15 22:45:56
If you are in a subdirectory of your working copy (for instance, linux-2.6/drivers/net) and use git-format-patch with -o to a sequence of ../ (for instance, -o ../../../) to write to the working copy's parent directory, it instead interprets the directory passed to -o as relative to the root of the working copy, instead of the expected current directory. Testcase: mkdir a cd a git init mkdir b touch b/c git add b/c git commit -m 'test' cd b echo 'test' > c git commit -a -m 'test' git format-patch -o ../ HEAD^..HEAD Expected result: put the patch within the "a" directory Result with v1.6.1: put the patch within the parent of the "a" directory (This testcase uses ../ instead of ../../ to avoid putting the patch file in an unexpected place, like in your home directory, which is what would happen in practice.) -- Cesar Eduardo Barros cesarb@cesarb.net cesar.barros@gmail.com