![]() ![]() gitconfig or simply run the following command git config alias. Here is a solution that defines a git alias, so you will be able use it like that : git rblame -M -n -L '/REGEX/,+1' FILE It looks like the feature has been considered, but not finished, for git itself. The primary way this could happen if the line was changed as part of a merge conflict resolution.)Įdit: I happened across this mailing list post from March 2011 today, which mentions that tig and git gui have a feature that will help you do this. (Note that this will fail you if the last commit that changed the line was a merge commit. the same thing starting from the commit before the last time the file was changed. Grab those, and run git blame -n $n,$n $commit^ $file, i.e. The first field is the previous commit touched, and the second field is the line number in that commit, since it could've changed. I don't have time to write out code just now, but. For example: git blame -L '/variable_name *= */',+1īut this only finds the first match for that regex, so if you don't have a good way of matching the line, it's not too helpful. an assignment to a variable whose name never changed, you could use the regex choice for git blame -L. If you're lucky enough that the line always has some identifying characteristic, e.g. It's made tricky by the fact that it's rare for a single line to change several times without the rest of the file changing substantially too, so you'll tend to end up with the line numbers changing a lot. After that, the easiest way to record all removals, additions, and modifications in the working tree is. Alternately you could rsync the changes into the working tree. and then untar the new code in the working tree. I don't believe there's anything built-in for this. Typically you would first remove all tracked files from the working tree using this command: git ls-files -z xargs -0 rm -f. Rename 'git-help-browse.sh' to 'git-web-browse.sh'. Web-browse: support opera, seamonkey and elinksĭiff -git a/git-web-browse.sh b/git-web-browse.sh Since Git 1.8.4, git log has -L to view the evolution of a range of lines.įor example, suppose you look at git blame's output. ![]() See also Git: discover which commits ever touched a range of lines. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |