git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cesar Eduardo Barros <cesarb@cesarb.net>
To: git@vger.kernel.org
Subject: git-format-patch with -o ../ in subdir of working copy writes output in wrong place
Date: Mon, 12 Jan 2009 20:04:32 -0200	[thread overview]
Message-ID: <496BBE70.9060405@cesarb.net> (raw)

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

             reply	other threads:[~2009-01-12 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-12 22:04 Cesar Eduardo Barros [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496BBE70.9060405@cesarb.net \
    --to=cesarb@cesarb.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).