From: Junio C Hamano <gitster@pobox.com>
To: Kai Blin <kai@samba.org>
Cc: git@vger.kernel.org
Subject: Re: Directory renames without breaking git log.
Date: Thu, 04 Sep 2008 15:06:27 -0700 [thread overview]
Message-ID: <7vfxof1s7w.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 200809042252.37329.kai@samba.org
Kai Blin <kai@samba.org> writes:
> On Thursday 04 September 2008 21:49:27 Junio C Hamano wrote:
>
>> > git blame still works, and git log --sparse path/to/file works, of
>> > course. --sparse makes giving a path a bit pointless, of course, but we
>> > probably can live with that for time being. I'm still open for
>> > suggestions, of course. :)
>>
>> Give both directories, like:
>>
>> "git log -- newdir olddir"
>>
>> perhaps?
>
> Better, but really ugly, as we'll have to keep doing this for the rest
> of the project's life to get the full history. And while it's all nice
> and fun for git log -- source3/configure.in source/configure.in, it's
> less fun for deeper paths.
Yes, following across subtree merges _could_ be improved.
But another thing I should mention in this context is that you should not
take --follow option (at least in the current form) too seriously.
I see it's been a while --- the last time I did this was October 2006 if I
am not mistaken. It's time of the year I should point at one of the most
important articles ever written on this mailing list:
http://thread.gmane.org/gmane.comp.version-control.git/27/focus=217
After understanding what Linus envisioned back then, why what he said are
important are important and why what he dismissed as uninteresting are
indeed uninteresting, things to think about now are:
- "blame" (especially with -C -C), as you found out already, does answer
the more important question "where did this come from"; and
- the question "log --follow $this_file" is asking is exactly "where did
this file come from". Remember what adjective was used for the
question in the article?
I also should mention that --follow was done by Linus as a hack with
known limitations.
Potential improvements to follow possible renames fully would involve:
* allow not just a single path but a set of pathspecs to be recorded
during --follow traversal;
* allow the above information be associated with individual commits, not
as a single global state in the traversal machinery;
* enhance the logic to update the pathspecs information kept above when
you hit renames while traversing the history. An important part of
this job involves inferring a wholesale rename of a directory by
looking at many files moved from one place to another, which we
currently do not do anywhere in git.
If you do all of the above, it will become a feature, not a hack with
known limitation. But I do not think anybody so far thought it is worth
the effort, only to answer the "where did this file come from" (ituot ue
zaf m eqzeunxq cgqefuaz).
Personally I feel that this is slightly closer to "I might do this myself
if I had infinite amount of time and I am really bored" than "I don't
care; patches welcome" category.
next prev parent reply other threads:[~2008-09-04 22:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 21:38 Directory renames without breaking git log Kai Blin
2008-09-04 0:16 ` Tarmigan
[not found] ` <200809040853.36433.kai@samba.org>
2008-09-04 18:35 ` Tarmigan
2008-09-04 19:45 ` Kai Blin
2008-09-04 19:49 ` Junio C Hamano
2008-09-04 20:52 ` Kai Blin
2008-09-04 22:06 ` Junio C Hamano [this message]
2008-09-04 20:41 ` Jakub Narebski
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=7vfxof1s7w.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kai@samba.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).