Hi Ken,

the 'git am' is a shell script 'git-am.sh' see 
https://github.com/git/git/blob/master/git-am.sh for a bit of debugging...

[sorry for the top post on these HTML emails]
  ----- Original Message ----- 
  From: Ken Tanzer 
  To: git-users@googlegroups.com 
  Cc: Ken Tanzer ; Philip Oakley 
  Sent: Sunday, November 10, 2013 8:30 PM
  Subject: Re: [git-users] git am "patch does not apply" on removed file

  Hi Philip, and thanks for the reply.  I've tried this on two Linux 
machines--Ubunut 13.04 with git, and Centos 6 with git 1.7.1.

  If I pull the update into another repository, I can merge it fine, so this 
problem is really with the patch.  It looks to me like either format-patch or 
am are doing something wrong.

  Regarding your numbered questions:

  1)  When I delete other files, the patch cites /dev/null as well, and those 
patches apply cleanly.
  2) The result of the git rm is to delete the file.  The am fails, so it does 
not do anything
  3) In this case, I gave the commit the message "Test deleting jquery file", 
which is what you're seeing there.  It doesn't seem to be a permission problem, 
as git is able to both delete and recreate the file without problem.

  I'm still hoping for other explanation, but right now it seems like a bug to 


  On Sunday, November 10, 2013 3:36:48 AM UTC-8, Philip Oakley wrote:
    ----- Original Message ----- 
    From: Ken Tanzer 
    To: git-...@googlegroups.com 
    Sent: Sunday, November 10, 2013 8:49 AM 
    Subject: [git-users] git am "patch does not apply" on removed file 

    Hello.  I have some patches I was having problems with, and have boiled 
    down a simple example.  If I try to remove certain files, the patch does 
    not apply.  In this case, I'm specifically trying to delete an older 
    version of jquery-ui (jquery-ui-1.8.custom.min.js).  I can delete other 
    files, both text and binary, with the commands below, but it fails on 
    this file.  Am I doing something wrong or missing something?  I get the 
    same problem on git 1.7.1 and  Any help appreciated.  Thanks. 


    p.s.,  I've also attached the patch file that was created. 

    git clone git://git.code.sf.net/p/agency/code agency-code # it is only 

    cd agency-code 
    md5sum jquery-ui-1.8.custom.min.js 
    --> 6e7569e2fed16a02a6be092ef4e4d756  jquery-ui-1.8.custom.min.js 
    git rm jquery-ui-1.8.custom.min.js 
    git commit 
    md5sum jquery-ui-1.8.custom.min.js 
    --> md5sum: jquery-ui-1.8.custom.min.js: No such file or directory 
    git format-patch HEAD~1 
    git reset --hard HEAD~1 
    md5sum jquery-ui-1.8.custom.min.js 
    --> 6e7569e2fed16a02a6be092ef4e4d756  jquery-ui-1.8.custom.min.js 
    git am 0001* 

    --> Applying: Test deleting jquery file. 
    error: patch failed: jquery-ui-1.8.custom.min.js:1 
    error: jquery-ui-1.8.custom.min.js: patch does not apply 
    Patch failed at 0001 Test deleting jquery file. 
    The copy of the patch that failed is found in: 
    When you have resolved this problem, run "git am --resolved". 
    If you prefer to skip this patch, run "git am --skip" instead. 
    To restore the original branch and stop patching, run "git am --abort". 
    <Patch extract> 
    diff --git a/jquery-ui-1.8.custom.min.js b/jquery-ui-1.8.custom.min.js 
    deleted file mode 100644 
    index 65966b0..0000000 
    --- a/jquery-ui-1.8.custom.min.js 
    +++ /dev/null 
    @@ -1,374 +0,0 @@ 
    </Patch extract> 

    Some bikeshedding. 

    There was a discussion recently on the deveolpers list regarding merging 
    a file deletion where the point was made that a diff simply removes 
    lines, rather than 'deleting a file'. while that wasn't your case it 
    probably has some relevance. 

    Is this on a Linux system or a Windows system, and what OS / Git 
    versions are you using? 

    Some things to look at / consider: 
    1: The diff is relative to dev/null rather than the same file which may 
    confuse some OS's - should it / is it (the OS) try renaming the file. 
    [I'd expect that this was a solved problem but its my first thought] 

    2: the result of the application is an empty file. What does the OS do - 
    write an empty file, or delete the file? 

    3: Your error message is "failed at 0001 Test deleting jquery file" 
    which suggest that the permissions are not in the patches favour and the 
    deletion got rejected. What are it's permissions? Does the process have 
    sufficient permission to d the deletions? 


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to