Re: git add -i doesn't update permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 26, 2008 at 11:23:32AM +0100, Jörg Sommer wrote:

> +test_expect_success 'update file permissions' '
> +       git reset --hard &&
> +       chmod +x file &&
> +       printf "p\n1\n" | git add -i
> +'

I'm not sure this is really a bug (but rather a feature request, which I
will explain below). add--interactive has two modes for moving changes
to files into the index:

  1. 'u' will 'update' the file in the index, adding the new content and
     any mode changes

  2. 'p' will show you each patch hunk from the file, which can then
     either be added or not.

You are using 'p' and expecting it to work with the file mode, when it
is purely about picking content hunks.

So I think the test _should_ be

  printf "u\n1\n" | git add -i

in which case it works fine.

Now, if you are interested in adding the mode change of a file but _not_
its content, I think that is a reasonable thing to ask for. And it's
something that is not possible with "add -i" right now, I don't think.
You seemed to expect that 'p' would present the mode change and say "do
you want to stage this?" which I think is a reasonable interface. Though
in that case "[p]atch" should perhaps be "[p]artial update".

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux