From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <junkio@cox.net>
Subject: Re: [PATCH 2/2] Add keyword unexpansion support to convert.c
Date: Tue, 17 Apr 2007 12:35:33 +0100 [thread overview]
Message-ID: <200704171235.34793.andyparkins@gmail.com> (raw)
In-Reply-To: <7v7isbpb0p.fsf@assigned-by-dhcp.cox.net>
On Tuesday 2007 April 17 11:09, Junio C Hamano wrote:
> In http://article.gmane.org/gmane.comp.version-control.git/44654,
> Linus said:
> And *I* claim that if you don't get an immediate and empty diff, your
> system is TOTALLY BROKEN.
Well that one is easy - the file is normalised to contain collapsed keywords
upon checkin, so diff works the same as it ever did. The output would be
immediate and empty so is not TOTALLY BROKEN.
> $ git checkout B
>
> should be immediate and instantaneous.
Now - that's a much better argument. However, it's not relevant, keywords (in
other VCSs, and so why not in git) are only updated when a file is checked
out. There is no need to touch every file. It's actually beneficial,
because the keyword in the file is the state of the file at the time it was
checked in - which is actually more useful than updating it to the latest
commit every time.
That means you're only ever expanding in a file that your changing anyway - so
it's effectively free. git-checkout would still be immediate and
instantaneous.
> If you try to keyword expand commit id, date or anything that is
> sensitive to *how* you got there, even though A and B have the
> exact same set of blobs, you have to essentially update all of
> them. Computing what to expand to takes (perhaps prohibitively
> expensive) time, but more importantly rewriting the whole 20k
> (or howmanyever you have in your project) files out becomes
> necessary, if your keyword expansion wants to say "oh, this file
> was taken from a checkout of branch B", for obvious reasons.
Ignoring the fact that expansion is only when a file is checked out; I'd argue
that it's your own fault if you enable keyword expansion on twenty thousand
files. A lot of the discussion has been about how useless keyword expansion
is in almost every case. I only want it for a few files in my repository; so
am willing to pay the small computing cost. Obviously keywords would be
disabled by default - in which case, you get what you deserve if you enable
them on everything.
Putting my own selfish requirements aside, from a purely "mine is better than
yours" point of view, git can't do something that CVS (in all it's
horridness) can. It's distinctly off-putting to people when they
say "keyword expansion", that the response is "YOU'RE AN IDIOT - GO AWAY -
YOU DON'T DESERVE TO USE GIT"; and back they'll scurry to CVS/subversion.
> Keyword expanding blob-id, or munging line-endings to CRLF form
> on platforms that want it, do not have this problem, as how you
> reached to the blob content does not affect the result of
> expansion, therefore not just the blobs in commit A and commit B
> but the working tree checked out of them must match with each
> other.
That's true - however, even if the only keyword git supports is $BlobID$, that
would address a large proportion of people's needs. As I said above though,
the keywords are only expanded on checkout (and checkin to be consistent).
> Having reiterated what Linus already said why keyword expansion
> and git are not friendly with each other (perhaps the reason is
> because the former is stupid and git is smart), I'd try to be a
(This is were my "YOU'RE AN IDIOT - YOU CAN'T USE GIT" alarm goes off). Git
is better than CVS/subversion in every respect - save this one. It's almost
completely free to do (apart from the initial coding of it of course) because
of these two factors:
- The keywords are collapsed in the repository
- The keywords are only expanded on checkout
It doesn't fundamentally alter anything that git does right now.
> * We do not do the borrowing from working tree when doing
> grep_sha1(), but when we grep inside a file from working tree
> with grep_file(), we do not currently make it go through
> convert_to_git() to fix line endings. Maybe we should, if
> only for consistency.
I'd actually argue not - git-grep searches the working tree. The expanded
keywords are in the working tree. Take the CRLF case - I'm a clueless user,
who only understands the system I'm working on. I want to search for all the
line endings, so I do git-grep "\r\n" - that should work, because I'm
searching my working tree.
> * We do not currently run convert_to_git() on the patch text
> given to git-apply; we could do so in parse_single_patch().
Yep - definitely; the applied patch should certainly be normalised before
application. I'd have to add it if I wanted keywords anyway wouldn't I?
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
next prev parent reply other threads:[~2007-04-17 11:35 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 [this message]
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
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=200704171235.34793.andyparkins@gmail.com \
--to=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).