git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rogan Dawes <lists@dawes.za.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nicolas Pitre <nico@cam.org>,
	David Lang <david.lang@digitalinsight.com>,
	Andy Parkins <andyparkins@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <junkio@cox.net>
Subject: Re: [PATCH 2/2] Add keyword unexpansion support to convert.c
Date: Wed, 18 Apr 2007 17:38:54 +0200	[thread overview]
Message-ID: <46263B8E.9080500@dawes.za.net> (raw)
In-Reply-To: <alpine.LFD.0.98.0704180748460.2828@woody.linux-foundation.org>

Linus Torvalds wrote:
> 
> On Wed, 18 Apr 2007, Rogan Dawes wrote:
>> Or similarly, when checking an "ODF" file in, the attribute would lead to an
>> appropriate script creating the "tree" of individual files.
>>
>> Does this sound workable?
> 
> I think it sounds very interesting, and I'd much rather do _those_ kinds 
> of rewrites than keyword unexpansion. And yes, some kind of generic 
> support for rewriting might give people effectively the keywords they want 
> (I think the CVS semantics are not likely to be logical, but people can 
> probably do something that works for them), and at that point maybe the 
> keyword discussion goes away too.
> 
> However, I don't know if it is "workable".
> 
> The thing is, it's easy enough (although potentially _very_ expensive) to 
> run some per-file script at each commit and at each checkout. But there 
> are some fundamental operations that are even more common:
> 
>  - checking for "file changed", aka the "git status" kind of thing
> 
>    Anything we do would have to follow the same "stat" rules, at a 
>    minimum. You can *not* afford to have to check the file manually.
> 
>    So especially if you combine several pieces into one, or split one file 
>    into several pieces, your index would have to contain the entry 
>    that matches the _filesystem_ (because that's what the index is all 
>    about), but then the *tree* would contain the pieces (or the single 
>    entry that matches several filesystem entries).

Right. I would imagine that the script would have to take care of 
setting timestamps in the filesystem appropriately, as well as passing 
them back to git when queried.

e.g. expanding test.odf/: (since we store it as a directory)

git calls "odf.sh checkout test.odf/ <sha1> <perms> <stat>"

odf checkout calls back into git to find out the details of the files 
under test.odf/, and creates a zip file containing the individual files, 
with appropriate timestamps.

User then opens the file using OO.o or whatever, makes some changes and 
saves the file.

The user then runs git status:

git calls "odf.sh stat test.odf/" (again, triggered by an attribute)

odf.sh does the equivalent of "zip -l" to get up to date stat info for 
the component files, and passes it back to git (via stdout?)

User commits his changes:

git calls "odf.sh checkin test.odf/"

odf.sh unpacks the individual files, calls back into git to create 
individual objects (using a fast-import-alike protocol over stdout?)


> 
>  - what about diffs (once the stat information says something has 
>    potentially changed)? You'd have to script those too, and it really 
>    sounds like some very basic operations get a _lot_ more expensive and 
>    complex.
 >
>    This is also related to the above: one of the most fundamental diffs is 
>    the diff of the index and a tree - so if the index matches the 
>    "filesystem state" and the trees contain some "combined entry" or 
>    "split entry", you'd have to teach some very core diff functionality 
>    about that kind of mapping.
> 
> In other words, I think it's too complicated. Not necessarily impossible, 
> but likely harder and more complex than it's really worth.
> 
> Having a 1:1 file mapping (like the CRLF<->LF object mapping is) is a lot 
> easier. You just have to make sure that the index has the *stat* 
> information from the filesystem, but the *sha1* identity information from 
> the git internal format, and things automatically just fall out right. But 
> if you have anything but a 1:1 relationship, it gets hugely more complex.
> 
> 			Linus

Absolutely. I just raised it now since it was originally mentioned quite 
a long time ago as a possible feature of git, and I couldn't see how it 
might work.

Thanks for your time,

Rogan

  parent reply	other threads:[~2007-04-18 15:39 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 [this message]
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=46263B8E.9080500@dawes.za.net \
    --to=lists@dawes.za.net \
    --cc=andyparkins@gmail.com \
    --cc=david.lang@digitalinsight.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=nico@cam.org \
    --cc=torvalds@linux-foundation.org \
    /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).