From: Junio C Hamano <gitster@pobox.com>
To: "John Cai via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, John Cai <johncai86@gmail.com>
Subject: Re: [PATCH 1/2] diff: use HEAD for attributes when using bare repository
Date: Tue, 14 Mar 2023 09:54:24 -0700 [thread overview]
Message-ID: <xmqqttynqnnj.fsf@gitster.g> (raw)
In-Reply-To: <0fc704cf1c0724473a61086098d44c3a82938b03.1678758818.git.gitgitgadget@gmail.com> (John Cai via GitGitGadget's message of "Tue, 14 Mar 2023 01:53:37 +0000")
"John Cai via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: John Cai <johncai86@gmail.com>
>
> (a4cf900e diff: teach diff to read algorithm from diff driver,
> 2022-02-20) does not support bare repositories.
Wrong placement of opening parenthesis, i.e. "a4cf900e (diff: teach
diff to read algorithm from diff driver, 2023-02-20)". The date is
also wrong. Use "git show -s --format=reference a4cf900e". Insert
its output directly to your editor instead of transcribing manually.
I do not think the commit is to blame in the first place for two
reasons.
* Even in a bare repository, the attributes defined in the
$GIT_DIR/info/attributes file are in effect, and the new feature
added by a4cf900e should work just fine with it.
* By definition, there is no working tree in a bare repository, and
it always has been naturally expected we won't read attributes
from working tree files. This is in no way limited to the diff
driver feature recently added.
So the above does not look like a good first sentence to explain
this change.
> Since running diff
> on bare repositories is often done on Git servers, it would be useful to
> allow bare repositories to also take advantage of setting the algorithm
> via the diff driver.
Since referring to in-tree attributes is often useful with any
command, not limited to "diff", I wonder if it is feasible to add
support for the --attr-source=<tree> option globally, instead of
implementing such an option piecemeal. If your "git diff" in a bare
repository starts honoring attributes recorded in HEAD, don't your
users expect your "git log" and "git show" to also honor them?
next prev parent reply other threads:[~2023-03-14 16:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 1:53 [PATCH 0/2] diff: support bare repositories when reading gitattributes for diff algorithm John Cai via GitGitGadget
2023-03-14 1:53 ` [PATCH 1/2] diff: use HEAD for attributes when using bare repository John Cai via GitGitGadget
2023-03-14 16:54 ` Junio C Hamano [this message]
2023-03-14 17:43 ` Junio C Hamano
2023-03-14 19:38 ` John Cai
2023-03-14 20:37 ` Junio C Hamano
2023-03-16 16:46 ` John Cai
2023-03-16 22:56 ` Junio C Hamano
2023-03-17 14:11 ` John Cai
2023-03-14 1:53 ` [PATCH 2/2] diff: add --attr-source to read gitattributes from a commit John Cai via GitGitGadget
2023-03-14 17:21 ` [PATCH 0/2] diff: support bare repositories when reading gitattributes for diff algorithm Philippe Blain
2023-03-14 19:18 ` John Cai
2023-03-14 20:44 ` Junio C Hamano
2023-03-16 14:29 ` Jeff King
2023-03-16 16:44 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqttynqnnj.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=johncai86@gmail.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).