{"thread":{"id":"18197","subject":"git-mergetool changes file rights?","startedAt":"2009-03-07T15:55:38Z","lastAt":"2009-03-07T19:54:44Z","messageCount":3,"participants":["Grzegorz Kossakowski","Charles Bailey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107305","messageId":"49B298FA.2050803@tuffmail.com","threadId":"18197","inReplyTo":null,"subject":"git-mergetool changes file rights?","fromName":"Grzegorz Kossakowski","fromEmail":"grek@tuffmail.com","sentAt":"2009-03-07T15:55:38Z","receivedAt":"2009-03-07T15:55:38Z","isPatch":false,"sender":{"key":"grek@tuffmail.com","avatar":"https://gravatar.com/avatar/98a80b7992e9f598c7b24addc73338dbacf94a14e4a14f3fa50c3f00dbee7dd3?d=mp&s=160"},"body":"Hello,\n\nI've stumbled upon very weird problem:\ngrek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> git --version\ngit version 1.6.1.3\ngrek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> ls -l\nrazem 40\n-rwxr-xr-x 1 grek users  773 mar  7 16:47 create-repo.sh\n-rwxr-xr-x 1 grek users 3219 mar  7 16:50 email-update.sh\n-rwxr-xr-x 1 grek users 3219 mar  7 16:50 email-update.sh.orig\n-rwxr-xr-x 1 grek users 2086 mar  7 16:47 move-svn-project.sh\n-rwxr-xr-x 1 grek users 1464 mar  7 16:47 update-authors.sh\n-rwxr-xr-x 1 grek users  156 mar  6 16:16 update-daily.sh\n-rwxr-xr-x 1 grek users  371 mar  7 16:47 update-every-minute.sh\n-rwxr-xr-x 1 grek users  215 mar  7 16:47 update-gitweb.sh\n-rwxr-xr-x 1 grek users 1104 mar  7 16:47 update-repo.sh\n-rwxr-xr-x 1 grek users  188 mar  7 16:47 update.sh\ngrek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> git mergetool\nmerge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff\nMerging the files: email-update.sh\n\nNormal merge conflict for 'email-update.sh':\n  {local}: modified\n  {remote}: modified\nHit return to start merge resolution tool (kdiff3):\nerror: open(\"bin/email-update.sh\"): Permission denied\nerror: unable to index file bin/email-update.sh\nfatal: updating files failed\ngrek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> ls -l\nrazem 40\n-rwxr-xr-x 1 grek users  773 mar  7 16:47 create-repo.sh\n---x------ 1 grek users 3219 mar  7 16:53 email-update.sh\n-rwxr-xr-x 1 grek users 3219 mar  7 16:53 email-update.sh.orig\n-rwxr-xr-x 1 grek users 2086 mar  7 16:47 move-svn-project.sh\n-rwxr-xr-x 1 grek users 1464 mar  7 16:47 update-authors.sh\n-rwxr-xr-x 1 grek users  156 mar  6 16:16 update-daily.sh\n-rwxr-xr-x 1 grek users  371 mar  7 16:47 update-every-minute.sh\n-rwxr-xr-x 1 grek users  215 mar  7 16:47 update-gitweb.sh\n-rwxr-xr-x 1 grek users 1104 mar  7 16:47 update-repo.sh\n-rwxr-xr-x 1 grek users  188 mar  7 16:47 update.sh\n\n\nNotice rights for email-update.sh.\n\nWhat's going on here?\n\n-- \nBest regards,\nGrzegorz Kossakowski\n"},{"id":"107328","messageId":"20090307194821.GA29312@hashpling.org","threadId":"18197","inReplyTo":"49B298FA.2050803@tuffmail.com","subject":"Re: git-mergetool changes file rights?","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2009-03-07T19:48:21Z","receivedAt":"2009-03-07T19:48:21Z","isPatch":false,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Sat, Mar 07, 2009 at 04:55:38PM +0100, Grzegorz Kossakowski wrote:\n> grek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> git mergetool\n> merge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff\n> Merging the files: email-update.sh\n> \n> Normal merge conflict for 'email-update.sh':\n>   {local}: modified\n>   {remote}: modified\n> Hit return to start merge resolution tool (kdiff3):\n> error: open(\"bin/email-update.sh\"): Permission denied\n> error: unable to index file bin/email-update.sh\n> fatal: updating files failed\n\nLooking at this sequence of error messages it looks like mergetool ran\nkdiff3 and this 'succeeded', but when mergetool came to 'git add' the\nresult of the merge it fell over in a heap because it couldn't read\nthe file because of the strange ---x------ permissions.\n\nmergetool just uses mv to create a backup of the to-be-merged path and\nthen uses cp to recreate the original path before invoking kdiff3. I\nhaven't managed to get cp to do anything other that use the same mode\nas the source file for a copied file.\n\nWhat version of kdiff3 are you using? I ask because this fix looks\nlike it may be relevant:\n\nhttp://kdiff3.svn.sourceforge.net/viewvc/kdiff3/trunk/kdiff3/src-QT4/fileaccess.cpp?r1=84&r2=96\n\nThe changelog for 0.9.95 includes this:\n\n- Fixed permissions when writing executable file. (Un*x only)\n\n-- \nCharles Bailey\nhttp://ccgi.hashpling.plus.com/blog/\n"},{"id":"107329","messageId":"49B2D104.80708@tuffmail.com","threadId":"18197","inReplyTo":"20090307194821.GA29312@hashpling.org","subject":"Re: git-mergetool changes file rights?","fromName":"Grzegorz Kossakowski","fromEmail":"grek@tuffmail.com","sentAt":"2009-03-07T19:54:44Z","receivedAt":"2009-03-07T19:54:44Z","isPatch":false,"sender":{"key":"grek@tuffmail.com","avatar":"https://gravatar.com/avatar/98a80b7992e9f598c7b24addc73338dbacf94a14e4a14f3fa50c3f00dbee7dd3?d=mp&s=160"},"body":"Charles Bailey pisze:\n> On Sat, Mar 07, 2009 at 04:55:38PM +0100, Grzegorz Kossakowski wrote:\n>> grek@linux-p3yg:~/asf/git/infrastructure/apache-git-mirrors/bin> git mergetool\n>> merge tool candidates: kdiff3 kdiff3 tkdiff xxdiff meld gvimdiff opendiff emerge vimdiff\n>> Merging the files: email-update.sh\n>>\n>> Normal merge conflict for 'email-update.sh':\n>>   {local}: modified\n>>   {remote}: modified\n>> Hit return to start merge resolution tool (kdiff3):\n>> error: open(\"bin/email-update.sh\"): Permission denied\n>> error: unable to index file bin/email-update.sh\n>> fatal: updating files failed\n> \n> Looking at this sequence of error messages it looks like mergetool ran\n> kdiff3 and this 'succeeded', but when mergetool came to 'git add' the\n> result of the merge it fell over in a heap because it couldn't read\n> the file because of the strange ---x------ permissions.\n> \n> mergetool just uses mv to create a backup of the to-be-merged path and\n> then uses cp to recreate the original path before invoking kdiff3. I\n> haven't managed to get cp to do anything other that use the same mode\n> as the source file for a copied file.\n> \n> What version of kdiff3 are you using? I ask because this fix looks\n> like it may be relevant:\n> \n> http://kdiff3.svn.sourceforge.net/viewvc/kdiff3/trunk/kdiff3/src-QT4/fileaccess.cpp?r1=84&r2=96\n> \n> The changelog for 0.9.95 includes this:\n> \n> - Fixed permissions when writing executable file. (Un*x only)\n\nHi Charles,\n\nI didn't thought of blaming kdiff3 which seems to be the real guilty for my problems. I'm using 0.9.94 version but I'm\nin the process of update.\n\nI'll try that version and report back if it fixes my problem.\n\nThanks for your help!\n\n-- \nBest regards,\nGrzegorz Kossakowski\n"}]}