From: Timo Hirvonen <tihirvon@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: pasky@ucw.cz, git@vger.kernel.org
Subject: Re: Following renames
Date: Sun, 26 Mar 2006 19:08:36 +0300 [thread overview]
Message-ID: <20060326190836.dbe95a72.tihirvon@gmail.com> (raw)
In-Reply-To: <7virq1sywj.fsf@assigned-by-dhcp.cox.net>
On Sat, 25 Mar 2006 18:49:48 -0800
Junio C Hamano <junkio@cox.net> wrote:
> Looking at the evolution of rev-list.c file itself was a good
> exercise to realize that rename tracking (more specifically,
> having whatchanged to follow renames) is not such a useful
> thing (at least for me).
It would be useful for me. I had all files organized in subdirectories,
but then noticed it was not good idea because make does not play nicely
with subdirs, so I moved all files to top level directory.
Now
git-whatchanged -p file.c
stops at the big rename. To continue I have to do
git-whatchanged -p -- <some-commit> <old-filename>
> Another example. Today's tar-tree updates have one interesting
> function I think should belong to strbuf.c, and before merging
> it to the mainline, I may move that function from tar-tree.c to
> strbuf.c. After that happens, if I run "whatchanged strbuf.c"
> to see where that function came from, I would want it to notice
> it came from tar-tree.c, although it is not a rename at all.
> Just one function moved from a file to another.
Yes in this case you can do
$ git-whatchanged strbuf.c
$ git-whatchanged tar-tree.c
but after rename...
$ git-whatchanged old-file.c
fatal: 'old-file.c': No such file or directory
$ touch old-file.c
$ git-whatchanged old-file.c
Hah, it worked!
Hmm... this works too without the touch-hack:
$ git-whatchanged file.c old-file.c
I wish I had known this before.
> What this suggests is that switching the set of paths to follow
> while traversing ancestry chain needs to depend on which part of
> the original file you are interested in. Marking "this commit
> renames (or copies) file A to file B" is not that useful -- for
> that matter, detecting at runtime like we currently do is not
> better either. If a file A and file B were cleaned up and
> merged into a single file C, which is in the tip of the tree,
> which one you would want whatchanged to switch following depends
> on which part of the C you were interested in.
OK, maybe following renames is not such a good idea. But for GUIs
(gitk, qgit) following renames or even file merges (select a file to
follow by clicking it) would be big plus.
--
http://onion.dynserv.net/~timo/
next prev parent reply other threads:[~2006-03-26 16:09 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-26 1:49 Following renames Petr Baudis
2006-03-26 2:49 ` Junio C Hamano
2006-03-26 3:52 ` Jakub Narebski
2006-03-27 6:00 ` Paul Jakma
2006-03-26 10:52 ` Petr Baudis
2006-03-26 10:55 ` Petr Baudis
2006-03-26 16:08 ` Timo Hirvonen [this message]
2006-03-26 16:43 ` Linus Torvalds
2006-03-26 16:31 ` Jakub Narebski
2006-03-26 16:46 ` Linus Torvalds
2006-03-26 17:10 ` Jakub Narebski
2006-03-26 18:10 ` Linus Torvalds
2006-03-26 19:22 ` Marco Costalba
2006-03-26 22:23 ` Linus Torvalds
2006-03-27 5:47 ` Marco Costalba
2006-03-27 6:46 ` Junio C Hamano
2006-03-27 8:07 ` Linus Torvalds
2006-03-27 11:19 ` Marco Costalba
2006-03-27 11:30 ` Johannes Schindelin
2006-03-27 16:52 ` Linus Torvalds
2006-03-27 11:55 ` Marco Costalba
2006-03-27 12:27 ` Andreas Ericsson
2006-03-27 6:55 ` Jakub Narebski
2006-03-27 7:40 ` David Lang
2006-03-27 7:53 ` Jakub Narebski
2006-03-26 3:19 ` Linus Torvalds
2006-03-26 7:35 ` Ryan Anderson
2006-03-26 21:09 ` Petr Baudis
2006-03-26 10:07 ` Petr Baudis
2006-03-26 10:34 ` Fredrik Kuivinen
2006-03-26 16:33 ` Linus Torvalds
2006-03-26 19:14 ` Petr Baudis
2006-03-26 20:31 ` Petr Baudis
2006-03-26 22:22 ` Linus Torvalds
2006-03-26 22:31 ` Petr Baudis
2006-03-26 22:43 ` Junio C Hamano
2006-03-26 23:10 ` Linus Torvalds
2006-03-27 7:30 ` Junio C Hamano
2006-03-26 23:09 ` Linus Torvalds
2006-03-26 23:26 ` Petr Baudis
2006-03-27 21:59 ` Petr Baudis
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=20060326190836.dbe95a72.tihirvon@gmail.com \
--to=tihirvon@gmail.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=pasky@ucw.cz \
/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