From: Neal Kreitzinger <nkreitzinger@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Neal Kreitzinger <neal@rsss.com>, git@vger.kernel.org
Subject: Re: filtering out mode-change-only changes
Date: Wed, 29 Feb 2012 13:11:03 -0600 [thread overview]
Message-ID: <4F4E7847.9030402@gmail.com> (raw)
In-Reply-To: <7vipiqwb2g.fsf@alter.siamese.dyndns.org>
On 2/28/2012 9:52 PM, Junio C Hamano wrote:
> Junio C Hamano<gitster@pobox.com> writes:
>
>> "Neal Kreitzinger"<neal@rsss.com> writes:
>>
>>> What is the best way to filter out the "mode change only" entries from a
>>> "name-status diff result" listing of changed files?
>>> ...
>> I do not know about random scripts people write, but there is nothing
>> built-in.
>
> Having said that, if we _were_ to do this built-in, an obvious logical
> place to do so is to define a new DIFF_OPT_IGNORE_EXECUTABLE_BIT, teach
> "--ignore-executable-bit" command line option to diff_opt_parse(), and
> then teach diff_resolve_rename_copy() to consider this bit when the code
> originally set DIFF_STATUS_MODIFIED. Instead, the updated code that is
> working under --ignore-executable-bit option would drop such a filepair
> from diff_queued_diff.
>
> I do not know if such a change is worth doing, though. It depends on the
> real reason why do you have so many "mode change only" changes that would
> make rebasing or cherry-picking too troublesome.
>
I see three parts to this issue that are related but also independent:
Questions:
(Q1) Is the user handling filemodes correctly in git?
(Q2) Why does the user need to interrogate filemodes in git?
(Q3) How are file modes interrogated by the user in git?
Some Answers:
Q1: Is the user handling filemodes correctly in git?
A1-1: (My Context)
Perhaps I'm not, but I'm not prepared to ignore filemodes. I think I
need to be aware of what's changing. Blasting everything with the linux
chmod 777 shotgun, or the git core.filemode=false shotgun does not seem
like the right answer to me. I need to do more homework on linux
permissions and git executable bit tracking.
A1-2: (General Context)
Some users do legitimately choose to have core.filemode=true and are
correct in doing so.
Q2: Why does the user need to interrogate filemodes in git?
A2-1: (My Context)
After a rebase we need to review what changed with a 4-way diff to have
the full context of merge-base, topic, upstream, and merged. Because we
are mere-mortals, we want to use gui side-by-side diff (ie, diffuse)
instead of 4-way combined diff. git-difftool only takes two file parms
so I have to write my own script. git-mergetool's can display 4-way diff
but insist on mangling the $MERGED file with their own attempts at
redoing the merge, ie. creating their own merge conflicts even though
$MERGED has no conflict markers on input.
A2-2: (General Context)
"Vendor code drops" (see git-rm manpage) can have substantial
file-mode-only changes along with real content changes due to incorrect
tar procedures and/or the vendor's filesystem being a "mode breaking
filesystem". Also, there are these human stdin's going about
capriciously with a free-will doing chmod's.
Q3: How are file modes interrogated by the user in git?
A3-1: (Some Current Options)
--name-status lumps file-mode-only changes and content changes together
under status "M".
--raw can be parsed to discern filemode changes concurrent with
identical content sha1's.
--summary "mode change" entries might also be usable to apply a filter
to --name-status results.
A3-2: (Some Desired Options)
--name-status learns a new status for file-mode-only changes (ie, "P"
for "P"ermissions).
--raw learns "P+x" and "P-x" in the status column to tell you if the
executable bit was added or removed.
I wonder if filemode tracking was somewhat of an afterthought of the
content-is-king design of git and that is why it is semi-opaque.
v/r,
neal
next prev parent reply other threads:[~2012-02-29 19:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-29 2:31 filtering out mode-change-only changes Neal Kreitzinger
2012-02-29 3:40 ` Junio C Hamano
2012-02-29 3:52 ` Junio C Hamano
2012-02-29 19:11 ` Neal Kreitzinger [this message]
2012-02-29 19:52 ` Junio C Hamano
2012-03-03 22:16 ` Pete Harlan
2012-02-29 22:17 ` Junio C Hamano
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=4F4E7847.9030402@gmail.com \
--to=nkreitzinger@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=neal@rsss.com \
/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).