From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Andy Parkins <andyparkins@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH 2/2] Add keyword unexpansion support to convert.c
Date: Tue, 17 Apr 2007 08:46:27 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0704170833560.5473@woody.linux-foundation.org> (raw)
In-Reply-To: <7v7isbpb0p.fsf@assigned-by-dhcp.cox.net>
On Tue, 17 Apr 2007, Junio C Hamano wrote:
>
> Andy Parkins <andyparkins@gmail.com> writes:
>
> > No parsing of the keyword itself is performed, the content is simply
> > dropped.
>
> You are sidestepping the most important problem by doing this.
I obviosly agree (and I agree with everything in your email), but:
> The only sensible keyword you could have, without destroying
> what git is, is blob id. No commit id, no date, no author.
Yes. And I already talked about some of the very fundamental problems that
keyword expansion has (ie switching branches is basically impossible to do
without checking out _every_single_file_ with the "keyword" attribute
set. There are others).
Now, unexpansion is trivial to do (it really *is* the same as the
"CRLF->LF" translation: that's technically really just an "unexpansion"
too). And it should work.
The way this does unexpansion also breaks "git diff" in that it bassically
always makes diff *ignore* the keywords. In other words, when you do
git diff A..B
and send the diff to somebody else, they'll never see any keywords at all!
Now, that obviously fulfills my requirement that the diff be empty if A
and B are the same, so you should expect me to be happy. But I'm not
happy, because if the other person also is using git, HE CANNOT EVEN APPLY
THE DIFF! Even if he's at "A", and thus gets a diff that is supposed to
apply *exactly*, he'll get rejects if there were other changes around the
unexpanded keyword (which *he* will have expanded in his working tree, of
course!)
See? Keywords simply *cannot* work. They're broken. Either you can ignore
them (and not show them in diffs), in which case the diff is broken, or
you can not ignore them (and show them in diffs) in which case the diff is
*also* broken, just differently.
The only sane and workable case is to not have them at all. Any keyword
expansion will *always* result in problems. You simply cannot do it right.
As I mentioned originally, it results in problems in CVS too, it's just
that CVS really has so many other issues that you seldom see the problems.
Ok, after that new rant against keywords, I will say one positive thing:
- keyword *unexpansion* is certainly easy (exactly because it's
stateless)
- if we want to support a git that only does "unexpansion", you can
probably hack around stupid release scripting more easily. You can add
your keywords *outside* of git, and git will simply ignore them.
So I'm actually not against keyword un-expansion. It has none of the
fundamental problems that actually expanding the keywords has. It's
literally no different from CRLF->LF translation. It can cause confusion,
but if it has to be explicitly enabled with an attribute and is never done
automatically, then having some support for unexpansion and letting the
user who wants to use keywords use his own "wrapper scripts" around git to
do his own expansion, be my guest..
You would be unable to do fundamental operations like "git checkout B" to
jump to another branch, but if you don't support multiple branches and
want to just act like CVS, maybe git unexpanding the crap will help you:
you can add your own keywords, happy in the knowledge that git simply
won't *care* about them, and will never see them.
So I absolutely detest keyword expansion and actually have a lot of
arguments for why I don't think it *can* work even in theory (except by
being totally unusable), but I don't have the *un*expansion.
Linus
next prev parent reply other threads:[~2007-04-17 15:46 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 9:41 [PATCH 2/2] Add keyword unexpansion support to convert.c Andy Parkins
[not found] ` <200704171803.58940.an dyparkins@gmail.com>
2007-04-17 10:09 ` Junio C Hamano
2007-04-17 11:35 ` Andy Parkins
2007-04-17 15:53 ` Linus Torvalds
2007-04-17 17:03 ` Andy Parkins
2007-04-17 18:12 ` Linus Torvalds
2007-04-17 19:12 ` Andy Parkins
[not found] ` <alpine.LFD. 0.98.0704171530220.4504@xanadu.home>
2007-04-17 19:41 ` Nicolas Pitre
2007-04-17 19:45 ` David Lang
[not found] ` <alpin e.LFD.0.98.0704171624190.4504@xanadu.home>
2007-04-17 20:29 ` Nicolas Pitre
2007-04-17 20:05 ` David Lang
2007-04-17 21:16 ` Nicolas Pitre
[not found] ` <7vy7k qlj5r.fsf@assigned-by-dhcp.cox.net>
2007-04-17 20:53 ` David Lang
2007-04-17 21:52 ` Andy Parkins
2007-04-17 22:40 ` Junio C Hamano
2007-04-18 2:39 ` Nicolas Pitre
2007-04-18 5:04 ` Junio C Hamano
2007-04-18 14:56 ` Nicolas Pitre
2007-04-18 11:14 ` Johannes Schindelin
2007-04-18 15:10 ` Nicolas Pitre
2007-04-19 8:19 ` Johannes Schindelin
2007-04-21 0:42 ` David Lang
2007-04-21 1:54 ` Junio C Hamano
2007-04-21 2:06 ` Nicolas Pitre
2007-04-21 23:31 ` David Lang
2007-04-18 6:24 ` Rogan Dawes
2007-04-18 15:02 ` Linus Torvalds
2007-04-18 15:34 ` Nicolas Pitre
2007-04-18 15:38 ` Rogan Dawes
2007-04-18 15:59 ` Nicolas Pitre
2007-04-18 16:09 ` Rogan Dawes
2007-04-18 17:58 ` Alon Ziv
2007-04-17 19:54 ` Linus Torvalds
2007-04-17 20:46 ` Andy Parkins
2007-04-17 20:52 ` [PATCH] Add keyword collapse " Andy Parkins
2007-04-17 21:10 ` [PATCH 2/2] Add keyword unexpansion " Linus Torvalds
2007-04-17 21:13 ` Linus Torvalds
2007-04-18 11:11 ` Johannes Schindelin
2007-04-20 11:32 ` Nikolai Weibull
2007-04-17 21:18 ` Martin Langhoff
2007-04-17 21:24 ` Junio C Hamano
2007-04-20 0:30 ` Jakub Narebski
2007-04-21 0:47 ` David Lang
2007-04-17 15:46 ` Linus Torvalds [this message]
2007-04-17 10:41 ` Johannes Sixt
2007-04-17 15:32 ` Linus Torvalds
2007-04-17 17:10 ` Andy Parkins
2007-04-17 17:18 ` Rogan Dawes
2007-04-17 18:23 ` Linus Torvalds
2007-04-17 20:27 ` Rogan Dawes
2007-04-17 23:56 ` Robin H. Johnson
2007-04-18 0:02 ` Junio C Hamano
2007-04-18 0:26 ` J. Bruce Fields
2007-04-18 1:19 ` Linus Torvalds
2007-04-18 1:28 ` Junio C Hamano
2007-04-18 1:33 ` Linus Torvalds
2007-04-18 1:06 ` Robin H. Johnson
2007-04-18 1:15 ` Junio C Hamano
2007-04-18 1:42 ` Junio C Hamano
2007-04-18 2:53 ` Robin H. Johnson
2007-04-18 4:15 ` Daniel Barkalow
2007-04-18 11:32 ` Johannes Schindelin
2007-04-18 2:50 ` Martin Langhoff
2007-04-18 10:06 ` David Kågedal
2007-04-18 11:08 ` Robin H. Johnson
2007-04-17 21:00 ` Matthieu Moy
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=Pine.LNX.4.64.0704170833560.5473@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=andyparkins@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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).