git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-format-patch with -o ../ in subdir of working copy writes output in wrong place
@ 2009-01-12 22:04 Cesar Eduardo Barros
  2009-01-12 22:49 ` [PATCH] Teach format-patch to handle output directory relative to cwd Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Cesar Eduardo Barros @ 2009-01-12 22:04 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-13  9:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 22:04 git-format-patch with -o ../ in subdir of working copy writes output in wrong place Cesar Eduardo Barros
2009-01-12 22:49 ` [PATCH] Teach format-patch to handle output directory relative to cwd Junio C Hamano
2009-01-12 23:12   ` Cesar Eduardo Barros
2009-01-13  1:00     ` Junio C Hamano
2009-01-13  9:24       ` Cesar Eduardo Barros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).