git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sverre Rabbelier <srabbelier@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Mario Ferraro <fadinlight@gmail.com>
Subject: git am oddity
Date: Mon, 31 Mar 2014 14:58:22 -0700	[thread overview]
Message-ID: <CAGdFq_gZoiE_ah0VT5ZfQwg-zHNj6Q-RSB80f=BTf=U6+9L5UA@mail.gmail.com> (raw)

Hi,

I noticed something very odd with git am, and have been able to narrow
it down to a minimal example.

 git init tmp
 cd tmp
 mkdir -p foo/bar/baz
 cd foo/bar/baz
 echo file > file
 git add file
 git commit -m "1"
 echo other > other
 echo more >> file
 git add file other
 git commit -m "my test"
 git format-patch HEAD~..
 git reset --hard HEAD~
 # apply the patch in the current directory, chop off the leading directories
 git am -3 -p 3 0001-my-test.patch
 cd ../../..
 git ls-files

Expected output:
foo/bar/baz/file
foo/bar/baz/other

Actual output:
baz/other # the file addition was applied to the root of the
repository, instead of the current directory
foo/bar/baz/file # the file modification was correctly applied, yay

Is this expected behavior?

-- 
Cheers,

Sverre Rabbelier

             reply	other threads:[~2014-03-31 21:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 21:58 Sverre Rabbelier [this message]
2014-03-31 22:15 ` git am oddity Junio C Hamano
2014-03-31 22:38   ` Sverre Rabbelier

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='CAGdFq_gZoiE_ah0VT5ZfQwg-zHNj6Q-RSB80f=BTf=U6+9L5UA@mail.gmail.com' \
    --to=srabbelier@gmail.com \
    --cc=fadinlight@gmail.com \
    --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).