1. 22 2月, 2007 1 次提交
    • J
      git-apply: notice "diff --git" patch again · 9987d7c5
      Junio C Hamano 提交于
      Earlier one that tried to be too consistent with GNU patch by
      not stripping the leading path when we _know_ we are in a
      subdirectory and the patch is relative to the toplevel was a
      mistake.  This fixes it.
      
       - No change to behaviour when it is run from the toplevel of
         the repository.
      
       - When run from a subdirectory to apply a git-generated patch,
         it uses the right -p<n> value automatically, with or without
         --index nor --cached option.
      
       - When run from a subdirectory to apply a randomly generated
         patch, it wants the right -p<n> value to be given by the
         user.
      
      The second one is a pure improvement to correct inconsistency
      between --index and non --index case, compared with 1.5.0.  The
      third point could be further improved to guess what the right
      value for -p<n> should be by looking at the patch, but should be
      a topic of a separate patch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9987d7c5
  2. 21 2月, 2007 2 次提交
  3. 20 2月, 2007 3 次提交
    • J
      eac70c4f
    • J
      git-apply: require -p<n> when working in a subdirectory. · 56185f49
      Junio C Hamano 提交于
      git-apply running inside a subdirectory, with or without --index,
      used to always assume that the patch is formatted in such a way
      to apply with -p1 from the toplevel, but it is more useful and
      consistent with the use of "GNU patch -p1" if it defaulted to
      assume that its input is meant to apply at the level it is
      invoked in.
      
      This changes the behaviour.  It used to be that the patch
      generated this way would apply without any trick:
      
      	edit Documentation/Makefile
      	git diff >patch.file
      	cd Documentation
      	git apply ../patch.file
      
      You need to give an explicit -p2 to git-apply now.  On the other
      hand, if you got a patch from somebody else who did not follow
      "patch is to apply from the top with -p1" convention, the input
      patch would start with:
      
      	diff -u Makefile.old Makefile
      	--- Makefile.old
      	+++ Makefile
      
      and in such a case, you can apply it with:
      
      	git apply -p0 patch.file
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      56185f49
    • J
      git-apply: do not lose cwd when run from a subdirectory. · aea19457
      Junio C Hamano 提交于
      When a patch modifies (not deletes) the last file in a
      directory, because we treat a modification just as deletion
      followed by creation, and deleting the last file in a directory
      automatically rmdir(2)'s that directory, we ended up removing
      the directory, which can potentially be the cwd, and then
      recreating the same directory to create the patch result.
      
      Avoid the rmdir step when remove_file() is called only because
      we are replacing it with the result by later calling
      create_file().
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      aea19457
  4. 18 2月, 2007 2 次提交
  5. 14 2月, 2007 8 次提交
  6. 13 2月, 2007 20 次提交
  7. 12 2月, 2007 4 次提交