git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Filtering mode changes

From
MPMatt Pearson <404emailnotfound@gmail.com>
Date
Aug 1, 2008, 12:23 UTC
Message-ID
<706b4240808010523y33694ebfjad772ef26e015cbb@mail.gmail.com>
In-Reply-To
<loom.20080801T111754-982@post.gmane.org>
On Fri, Aug 1, 2008 at 7:25 AM, Stefan Naewe <stefan.naewe+git@gmail.com> wrote:
Show 18 quoted lines
> Hi there.
>
> Here's my story:
>
> - I did some minor modifications to a repo that I want to 'give back'.
> - I worked on my own branch (of course).
> - I was stupid to edit the files (that live on a linux box) through a windows
>  network share.
> - When I created diffs (using 'git format-patch') to send send 'upstream', I
>  noticed that the edited files got their executable bit set (old mode 100644 ->
>  new mode 100755)
> - I created another commit to undo the mode changes.
>
> My question:
>
> Is there a way to create clean diffs (between master and my branch) that don't
> contain the 'double mode change' (from 644 to 755 to 644) ?
>

You probably want to use 'git rebase -i master' and the 'squash' command to combine the changes into one. If multiple commits messed up the permissions, use the 'edit' command and the rebase will stop after the specified commits, allowing you to fix things up, then do 'git commit --amend'. Use 'git rebase --continue' to continue fixing the patches.

Previous: Stefan NaeweNext: Santi Béjar
Message 2 of 3 in “Filtering mode changes”
  1. Stefan NaeweAug 1, 2008
  2. Matt PearsonAug 1, 2008
  3. Santi BéjarAug 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.