[llvm-dev] GitHub Survey?

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 13 11:52:44 PDT 2016


> On Oct 13, 2016, at 11:36 AM, Renato Golin <renato.golin at linaro.org> wrote:
> 
> On 13 October 2016 at 19:09, Mehdi Amini <mehdi.amini at apple.com> wrote:
>> When I reach a commit that moved the function, I switch file, but continue
>> *from the same commit*. This is only possible in the same repository.
> 
> Due to their physical separation, I don't think people have been
> moving code between projects in that manner.

Most people are not doing this.

> 
> If we keep the separation (sub-mods), is it possible to move files
> between sub-modules?

Yes, but not with a single commit, it is “deleting code / file in repo X”, and then “adding code / file in repo Y”.
So the git log in repo Y stops at some point, where the commit message says “moving feature F from repo X”.
And then you need to close repo X, and use "git log” to find when it was taken out, and resume your blame from here.

> 
> If we do mono-repo, then the problem goes away.
> 
> 
>> Another thing I use daily is finding “when was this added”, using git
>> “pickaxe” (git log S ….). Which again works only inside a repository.
> 
> Uh, that looks nice. Can you share your alias? :)

No alias, standard git:  git log -S “something”

One description I found online (http://jfire.io/blog/2012/03/07/code-archaeology-with-git/ <http://jfire.io/blog/2012/03/07/code-archaeology-with-git/> ) is:

"Pickaxes are often useful for archaeological purposes, and git’s pickaxe is no exception. It refers to the -S option to git log. The -S option takes a string parameter and searches the commit history for commits that introduce or remove that string. That’s not quite the same thing as searching for commits whose diff contains the string—the change must actually add or delete that string, not simply include a line on which it appears.”

— 
Mehdi



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161013/67b2e75f/attachment.html>


More information about the llvm-dev mailing list