From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Jörg Sommer" <joerg@alea.gnuu.de>, git@vger.kernel.org
Subject: Re: git add -i doesn't update permissions
Date: Thu, 27 Mar 2008 09:08:03 -0700 [thread overview]
Message-ID: <7vfxucb15o.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20080327055746.GA8469@coredump.intra.peff.net
Jeff King <peff@peff.net> writes:
> 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.
It's worse than that. It _theoretically_ is possible that this limitation
becomes problematic if you are in this situation:
1. Notice a problem in the gostak script that it should distim doshes but
it doesn't.
2. Start working to change the gostak script.
3. Notice that the gistak script itself needs the +x bit but it doesn't.
4. Being a very disciplined person, you want to make sequence of commits
that record each separate logical change as a separate commit. You
would want to record "Add executable bit to the gostak script" first,
and then work further on the contents of the script to make "Enhance
the gostak script to distim doshes" as two logically separate steps.
This is not something you can do with "git add" in general, although I do
not see how this can be an issue in real life.
Two already available solutions are:
(1) git reset HEAD -- gostak ;# undo staged content changes
git update-index --chmod=+x gostak
git commit -m "Add executable bit to the gostak script"
edit gostak ;# work more
git add gostak
git commit -m "Enhance the gostak script to distim doshes"
(2) git stash ;# undo changes
chmod +x gostak
git add gostak
git commit -m "Add executable bit to the gostak script"
git stash pop ;# take the wip changes back
edit gostak ;# work more
git add gostak
git commit -m "Enhance the gostak script to distim doshes"
prev parent reply other threads:[~2008-03-27 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 10:23 git add -i doesn't update permissions Jörg Sommer
2008-03-27 5:57 ` Jeff King
2008-03-27 6:29 ` Jeff King
2008-03-27 6:32 ` Wincent Colaiuta
2008-03-27 16:08 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vfxucb15o.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=joerg@alea.gnuu.de \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).