You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wouldn't call this an "issue", but for me it's handy to run the script directly, without changing the .gitconfig. Like:
.../git-meld.pl HEAD^^ -- $PWD
all that was needed was:
@@ -157,13 +158,15 @@ sub copy_files_named_tree($$$) {
# diff viewer
sub link_files_working_dir($$) {
(my $file_list, my $out_dir) = @_;
+ my $git_root = cwd();
+ $git_root =~ s!/[^/]+$!! while (! -d $git_root."/.git");
# Because we're diffing against the working directory we wish to create a
# tree of links in the dest folder mirroring that in the repo.
# TODO: Fix this so we don't have to loop over each filename somehow
foreach my $filename (@$file_list) {
my $dir = $filename;
safe_system("mkdir", "-p", dirname("$out_dir/$filename"));
- safe_system("ln", "-s", cwd() . "/$filename", "$out_dir/$filename");
+ safe_system("ln", "-s", $git_root . "/$filename", "$out_dir/$filename")
}
}
I'm not sure if that's the correct way to detect the git root, but you get the idea.
This would be a useful feature but it would probably be better to use git rev-parse --show-toplevel to get the working directory rather than trying to reimplement the logic that git uses. It would also be good to have a test.
I wouldn't call this an "issue", but for me it's handy to run the script directly, without changing the .gitconfig. Like:
.../git-meld.pl HEAD^^ -- $PWD
all that was needed was:
I'm not sure if that's the correct way to detect the git root, but you get the idea.
Also, something you might consider:
a little more flexible....
BTW - awesome script - exactly what I was looking for :)
The text was updated successfully, but these errors were encountered: