{"thread":{"id":"14789","subject":"Filtering mode changes","startedAt":"2008-08-01T11:25:45Z","lastAt":"2008-08-01T12:32:03Z","messageCount":3,"participants":["Stefan Naewe","Matt Pearson","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"85891","messageId":"loom.20080801T111754-982@post.gmane.org","threadId":"14789","inReplyTo":null,"subject":"Filtering mode changes","fromName":"Stefan Naewe","fromEmail":"stefan.naewe+git@gmail.com","sentAt":"2008-08-01T11:25:45Z","receivedAt":"2008-08-01T11:25:45Z","isPatch":false,"sender":{"key":"stefan.naewe+git@gmail.com","avatar":"https://gravatar.com/avatar/ff9c89e7b42e5c7f494ef0f19ac9bde6693fb6465356711b8d4ed47d2108dd46?d=mp&s=160"},"body":"Hi there.\n\nHere's my story:\n\n- I did some minor modifications to a repo that I want to 'give back'.\n- I worked on my own branch (of course).\n- I was stupid to edit the files (that live on a linux box) through a windows\n  network share.\n- When I created diffs (using 'git format-patch') to send send 'upstream', I \n  noticed that the edited files got their executable bit set (old mode 100644 ->\n  new mode 100755)\n- I created another commit to undo the mode changes.\n\nMy question:\n\nIs there a way to create clean diffs (between master and my branch) that don't\ncontain the 'double mode change' (from 644 to 755 to 644) ? \n\nTIA\n\nStefan\n"},{"id":"85895","messageId":"706b4240808010523y33694ebfjad772ef26e015cbb@mail.gmail.com","threadId":"14789","inReplyTo":"loom.20080801T111754-982@post.gmane.org","subject":"Re: Filtering mode changes","fromName":"Matt Pearson","fromEmail":"404emailnotfound@gmail.com","sentAt":"2008-08-01T12:23:07Z","receivedAt":"2008-08-01T12:23:07Z","isPatch":false,"sender":{"key":"404emailnotfound@gmail.com","avatar":null},"body":"On Fri, Aug 1, 2008 at 7:25 AM, Stefan Naewe <stefan.naewe+git@gmail.com> wrote:\n> Hi there.\n>\n> Here's my story:\n>\n> - I did some minor modifications to a repo that I want to 'give back'.\n> - I worked on my own branch (of course).\n> - I was stupid to edit the files (that live on a linux box) through a windows\n>  network share.\n> - When I created diffs (using 'git format-patch') to send send 'upstream', I\n>  noticed that the edited files got their executable bit set (old mode 100644 ->\n>  new mode 100755)\n> - I created another commit to undo the mode changes.\n>\n> My question:\n>\n> Is there a way to create clean diffs (between master and my branch) that don't\n> contain the 'double mode change' (from 644 to 755 to 644) ?\n>\n\nYou probably want to use 'git rebase -i master' and the 'squash'\ncommand to combine the changes into one. If multiple commits messed up\nthe permissions, use the 'edit' command and the rebase will stop after\nthe specified commits, allowing you to fix things up, then do 'git\ncommit --amend'. Use 'git rebase --continue' to continue fixing the\npatches.\n"},{"id":"85897","messageId":"8aa486160808010532k3932979er1a457b0d627e988@mail.gmail.com","threadId":"14789","inReplyTo":"loom.20080801T111754-982@post.gmane.org","subject":"Re: Filtering mode changes","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2008-08-01T12:32:03Z","receivedAt":"2008-08-01T12:32:03Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Fri, Aug 1, 2008 at 13:25, Stefan Naewe <stefan.naewe+git@gmail.com> wrote:\n> Hi there.\n>\n> Here's my story:\n>\n> - I did some minor modifications to a repo that I want to 'give back'.\n> - I worked on my own branch (of course).\n> - I was stupid to edit the files (that live on a linux box) through a windows\n>  network share.\n\nThen, you should set core.fileMode to false.\n\n> - When I created diffs (using 'git format-patch') to send send 'upstream', I\n>  noticed that the edited files got their executable bit set (old mode 100644 ->\n>  new mode 100755)\n\nYou can just edit the patches and remove the \"old/new mode\" lines.\n\n> - I created another commit to undo the mode changes.\n\nYou can use \"git rebase -i\" and edit (or squash) the revision before\ngenerating the patch.\n\nSanti\n"}]}