From: Junio C Hamano Date: Thu, 19 Jan 2006 02:46:56 GMT Subject: Re: Something wrong with pickaxe? Message-ID: <7vwtgxlysf.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > Me, I find the pickaxe semantics so non-intuitive that I never use it > (that said, the counting begaviour is better than what it _used_ to be, > which, if I recall correctly, was just "it existed before, doesn't exist > now"). You are so polite to say "non-intuitive" when you mean "useless". I use pickaxe primarily when I want to find out what commit made the code into the current shape. For example, after I start debugging or code change, if I suspect the first "if (!nr_match) return;" is bogus in filter_refs() of fetch-pack.c, before declaring that code is bogus and start butchering it, I run something like this: $ git whatchanged -p -S'static void filter_refs(struct ref **refs, int nr_match, char **match) { struct ref *prev, *current, *next; if (!nr_match) return; ' master -- fetch-pack.c to find the commit that made the function to look like so, hoping to find the reason _why_ it is that way is explained in the log message for that commit. If the commit log is not enough, then next thing I do is to see its commit/author date and go back to the mailing list logs to see discussion around that timeframe. For this use pattern, even counting behaviour we added later is redundant, since "did not have it that way but now it does" is the only thing that matters. "What commits changed the lines that use this symbol over time" is not a question I ask pickaxe. When I ask a question about an individual symbol, such as "get_remote_heads", I often use "git grep", to learn what other existing users of the function would be affected in the current code if I changed that function, or to learn how other functions in the current code uses that symbol, but for that kind of research, historical usage of that symbol does not interest me. Having said all of the above, I agree a different kind of pickaxe that gives you "if you were to run diff -u between these two blobs, the resulting patch would contain this text" might also be useful, and I am very open to have such an additional diffcore module next to pickaxe (IOW, not a replacement). But it might not be as easy to use as the current pickaxe if the question I want to ask is "who made it into this shape".