-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors when running #7
Comments
I ran into some variation of this, some of which seem related to how git is configured to format diffs. I managed to munge it to work for the case I needed with this patch (warning: I don't know perl...): diff --git a/git-diff-blame b/git-diff-blame
index faf7075..5fc9006 100755
--- a/git-diff-blame
+++ b/git-diff-blame
@@ -18,8 +18,12 @@ sub parse_hunk_header {
sub get_blame_prefix {
my ($line) = @_;
- $line =~ /^(\^?[0-9a-f]+\s+(\S+\s+)?\([^\)]+\))/ or die "bad blame output: $line";
- return $1;
+ if ($line) {
+ $line =~ /^(\^?[0-9a-f]+\s+(\S+\s+)?\([^\)]+\))/ or die "bad blame output: $line";
+ return $1;
+ } else {
+ return ;
+ }
}
$git_root = `git rev-parse --show-toplevel`;
@@ -27,10 +31,10 @@ $git_root =~ s/^\s+//;
$git_root =~ s/\s+$//;
chdir($git_root) or die "$!";
-my ($oldrev, $newrev) = @ARGV;
+my ($oldrev, $newrev, @REST) = @ARGV;
$oldrev ||= 'HEAD';
if ($newrev) {
- open($diff, '-|', 'git', '--no-pager', 'diff', $oldrev, $newrev) or die;
+ open($diff, '-|', 'git', '--no-pager', 'diff', $oldrev, $newrev, @REST) or die;
} else {
open($diff, '-|', 'git', '--no-pager', 'diff', $oldrev) or die;
} |
hlovdal
pushed a commit
to hlovdal/git-diff-blame
that referenced
this issue
Feb 2, 2022
hlovdal
pushed a commit
to hlovdal/git-diff-blame
that referenced
this issue
Feb 2, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm getting some errors trying to run
git diff-blame
I'm on OSX with perl v5.18.2.
Any thoughts on what could be causing this? I haven't looked too deeply myself, but I haven't worked with perl in years...
The text was updated successfully, but these errors were encountered: