git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Martin Langhoff" <martin.langhoff@gmail.com>
To: "Linus Torvalds" <torvalds@osdl.org>
Cc: "Liu Yubao" <yubao.liu@gmail.com>,
	"Dongsheng Song" <dongsheng.song@gmail.com>,
	git@vger.kernel.org
Subject: Re: Does GIT has vc keywords like CVS/Subversion?
Date: Tue, 10 Oct 2006 10:08:15 +1300	[thread overview]
Message-ID: <46a038f90610091408y29f60a12gea7040b5412331c6@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0610090904360.3952@g5.osdl.org>

On 10/10/06, Linus Torvalds <torvalds@osdl.org> wrote:
> So:
>  - inside of the SCM, keyword substitution is pointless, since you have
>    much better tools available (like "git log filename")
>  - outside of the SCM, keyword substitution can make sense, but doing it
>    should be in helper scripts or something that can easily tailor it for
>    the actual need of that particular project.

For the outside of the SCM case, keyword subst is useful indeed if
someone has a $version_unknown tarball, unpacks it and hacks away. It
is a pretty broken scenario, and less likely to happen nowadays with
easy access to SCM tools.

However, I don't think that scenario is hard to support and Git can
have a much better story to tell than keyword substituting SCMs.

If we have a tool that I can pass a file or a directory tree and will
find the (perfectly|closely) matching trees and related commits.

For the single file case, searching for an exact SHA1 match is easy,
as is by path. If we get a file without a path it gets a bit harder --
is there a way to scan the object store for blobs of around a given
size (as the packing code does) from Perl? Actually, if we find a
relatively close match, it'd be useful to ask git if it's deltified
and ask for other members of the delta chain.

For the directory tree case, the ideal thing would be to build a
temporary index without getting the blobs in the object store, and
then do a first pass trying to match tree SHA1s. If the user has
modified a few files in a large project, it'll be trivial to find a
good candidate commit for delta. OTOH, if the user has indulged in
wide ranging search and replace... it will be well deserved pain ;-)

cheers,



martin

  reply	other threads:[~2006-10-09 21:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09  1:25 Does GIT has vc keywords like CVS/Subversion? Dongsheng Song
2006-10-09  2:44 ` Liu Yubao
2006-10-09  2:59   ` Petr Baudis
2006-10-09 16:13   ` Linus Torvalds
2006-10-09 21:08     ` Martin Langhoff [this message]
2006-10-09 22:48       ` Johannes Schindelin
2006-10-09 22:57         ` Martin Langhoff
2006-10-09 22:55       ` Junio C Hamano
2006-10-10  7:37       ` Rene Scharfe
2006-10-10 16:49       ` Shawn Pearce
2006-10-10 17:14         ` Linus Torvalds
2006-10-10 17:41           ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46a038f90610091408y29f60a12gea7040b5412331c6@mail.gmail.com \
    --to=martin.langhoff@gmail.com \
    --cc=dongsheng.song@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=yubao.liu@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.
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).