All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcus Comstedt <marcus@mc.pp.se>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/2] convert: fix normalization of foreign idents
Date: Sun, 12 Sep 2010 23:01:53 +0200	[thread overview]
Message-ID: <yf9hbhuisla.fsf@chiyo.mc.pp.se> (raw)
In-Reply-To: <7vmxrqjvf6.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Thu, 09 Sep 2010 17:26:21 -0700")


Hi Junio.


Junio C Hamano <gitster@pobox.com> writes:

> Would it be possible that the real culprit is that ident_to_worktree()
> does not always touch $Id$ in the first place?  Why isn't "$Id: garbage$"
> first cleaned and then smudged upon checkout?

Please see commit 07814d90095b65b4594efd47c69f9f171ef162d4, and
the discussion preceeding it.


> It also smells wrong that this "sometimes we convert, sometimes we don't"
> is a special case for "$Id$" and for no other conversion.  Why don't
> smudge/clean filter or CRLF conversion have the same issue that can be
> solved with the same approach as this patch takes?

I gather that this is because nobody has come up with a use case
for smudge/clean or CRLF where a (pervasive) non-normalized
representation in the repository makes sense.

Specifically, a foreign ident in the repo is not "garbage", but
something useful when you migrate a repo from a different VCS for (at
least) the following reasons:

* It allows you to check out a historical tree from the git repo which
  looks exactly like what it would look like if you checked it out
  from the previous system

* It provides an indication that a version of a file comes directly
  from the previous VCS, without any modification since the migration
  to git, and exactly where in the history of the previous VCS it has
  originated

* Quite frankly, idents generated by other VCSs contain more useful
  information than those generated by git, so it's a waste to discard
  them prematurely

The same effect can be achieved without direct support for foreign
idents by instead using fine-grained control in .gitattributes to
force -ident on any file which still has foreign idents, but there are
two downsides to this approach:

* A commit hook (and probably a pre-receive hook at the "blessed"
  repository) is needed to make sure that no commits are allowed to a
  file with foreign idents without also flipping the attribute from
  -ident to +ident

* Either a full enumeration of all files with foreign idents, or
  of all files with native idents, is needed in .gitattributes, so
  that a file can be either added to or removed from this list when
  making the first "native" commit to it

So it's possible, albeit slightly less practical, to do without this
feature.  If the decision to include it is reversed, 07814d90095b65
should probably be reverted.


  // Marcus

  reply	other threads:[~2010-09-12 21:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 21:30 Fix for normalization of foreign idents Marcus Comstedt
2010-08-23 21:30 ` [PATCH] convert: fix " Marcus Comstedt
2010-08-23 21:35 ` Fix for " Jonathan Nieder
2010-08-23 21:44   ` Marcus Comstedt
2010-08-23 22:33     ` Jonathan Nieder
2010-08-23 23:46       ` Junio C Hamano
2010-08-24  7:23         ` Marcus Comstedt
2010-09-06  9:42     ` Marcus Comstedt
2010-09-06 21:07       ` Jonathan Nieder
2010-09-07 19:37         ` Marcus Comstedt
2010-08-23  7:05           ` [PATCH v2 1/2] convert: fix " Marcus Comstedt
2010-09-10  0:26             ` Junio C Hamano
2010-09-12 21:01               ` Marcus Comstedt [this message]
2010-09-12 21:44                 ` Junio C Hamano
2010-09-12 22:06                   ` Marcus Comstedt
2010-09-13 22:00                     ` [PATCH] convert: generalize checksafe parameter Marcus Comstedt
2010-09-07 19:16           ` [PATCH v2 2/2] t0021: test checkout and commit of foreign idents Marcus Comstedt
2010-09-07 20:00           ` [PATCH v2 0/2] fix normalization of foreign idents (now with test cases) Marcus Comstedt
2010-09-08  4:32           ` Fix for normalization of foreign idents Jonathan Nieder

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=yf9hbhuisla.fsf@chiyo.mc.pp.se \
    --to=marcus@mc.pp.se \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.