From: Junio C Hamano <hidden> Date: 2018-02-16 18:56:07
Jeff King [off-list ref] writes:
So a full proposal would support both cases: "check this out in the
local platform's preferred encoding" and "always check this out in
_this_ encoding". And Lars's proposal is just the second half of that.
Actually, what you seem to take as a whole is just half of the
story. The other half that is an ability to say "what is in the
repository for this path is stored in this encoding". I agree that
"check it out in this encoding" is a useful thing to have, and using
the in-tree .gitattributes as a place to state the project-wide
preference may be OK (and .git/info/attributes should be able to
override it if needed -- this probably deserves to be added to a
test somewhere by this series).
Luckily, lack of 'in-repository-encoding' attribute is not a show
stopper for this series. A later topic could start with "earlier,
in order to make use of w-t-e attribute, you had to have your
contents in UTF-8. Teach the codepath to honor a new attribute that
tells in what encoding the blob contents are stored." without having
to be a part of this topic.
From: Jeff King <hidden> Date: 2018-02-16 19:26:04
On Fri, Feb 16, 2018 at 10:55:58AM -0800, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
So a full proposal would support both cases: "check this out in the
local platform's preferred encoding" and "always check this out in
_this_ encoding". And Lars's proposal is just the second half of that.
Actually, what you seem to take as a whole is just half of the
story. The other half that is an ability to say "what is in the
repository for this path is stored in this encoding". I agree that
"check it out in this encoding" is a useful thing to have, and using
the in-tree .gitattributes as a place to state the project-wide
preference may be OK (and .git/info/attributes should be able to
override it if needed -- this probably deserves to be added to a
test somewhere by this series).
If we are just talking about a check-out feature, I'm not sure that the
in-repository encoding is all that interesting. As with CRLFs, we would
be declaring UTF-8 as the "canonical" in-repo encoding for such
conversions. Is there a reason you'd want something else?
If the feature were "the in-repo encoding is X, and I want you to show
me a diff using encoding Y", then I could see the use of that (and I
think for most people's purposes that would be an equally valid solution
to their problem).
-Peff
From: Jeff King <hidden> Date: 2018-02-16 19:27:35
On Fri, Feb 16, 2018 at 02:25:41PM -0500, Jeff King wrote:
On Fri, Feb 16, 2018 at 10:55:58AM -0800, Junio C Hamano wrote:
quoted
Jeff King [off-list ref] writes:
quoted
So a full proposal would support both cases: "check this out in the
local platform's preferred encoding" and "always check this out in
_this_ encoding". And Lars's proposal is just the second half of that.
Actually, what you seem to take as a whole is just half of the
story. The other half that is an ability to say "what is in the
repository for this path is stored in this encoding". I agree that
"check it out in this encoding" is a useful thing to have, and using
the in-tree .gitattributes as a place to state the project-wide
preference may be OK (and .git/info/attributes should be able to
override it if needed -- this probably deserves to be added to a
test somewhere by this series).
If we are just talking about a check-out feature, I'm not sure that the
in-repository encoding is all that interesting. As with CRLFs, we would
be declaring UTF-8 as the "canonical" in-repo encoding for such
conversions. Is there a reason you'd want something else?
Maybe answering my own question: because your encoding of choice does
not round-trip to UTF-8?
In which case yeah, I could see choosing an in-repo encoding to possibly
be useful (but it also seems like a feature that could easily be tacked
on later if somebody cares).
-Peff
From: Lars Schneider <hidden> Date: 2018-02-21 18:06:17
On 16 Feb 2018, at 19:55, Junio C Hamano [off-list ref] wrote:
Jeff King [off-list ref] writes:
quoted
So a full proposal would support both cases: "check this out in the
local platform's preferred encoding" and "always check this out in
_this_ encoding". And Lars's proposal is just the second half of that.
Actually, what you seem to take as a whole is just half of the
story. The other half that is an ability to say "what is in the
repository for this path is stored in this encoding". I agree that
"check it out in this encoding" is a useful thing to have, and using
the in-tree .gitattributes as a place to state the project-wide
preference may be OK (and .git/info/attributes should be able to
override it if needed -- this probably deserves to be added to a
test somewhere by this series).
Good call! I'll add this test case!
Luckily, lack of 'in-repository-encoding' attribute is not a show
stopper for this series. A later topic could start with "earlier,
in order to make use of w-t-e attribute, you had to have your
contents in UTF-8. Teach the codepath to honor a new attribute that
tells in what encoding the blob contents are stored." without having
to be a part of this topic.
I have the impression that this is the purpose of the already existing
"encoding" attribute, no? AFAIK this attribute is only respected by
gitk, though. A future series could make Git respect this attribute too.
- Lars