wmanley / git-meld Goto Github PK
View Code? Open in Web Editor NEWWrapper around git and meld for comparing git trees
License: GNU General Public License v2.0
Wrapper around git and meld for comparing git trees
License: GNU General Public License v2.0
Because the path list is relative to the repo root.
I checkout to upmc, then run :
git meld master..upmc
Apply modifaction from master to upmc, try to save and got :
Error writing to /tmp/git-meld.s1fLZw/upmc/flushTomcatCache.sh
[Errno 13] Permission denied: '/tmp/git-meld.s1fLZw/upmc/flushTomcatCache.sh'.
Command line give this errors :
/usr/lib/meld/meld/meldwindow.py:572: Warning: g_object_set_qdata: assertion G_IS_OBJECT (object)' failed self.notebook.append_page( page.widget, nbl) /usr/lib/meld/meld/filediff.py:1005: Warning: g_object_set_qdata: assertion
G_IS_OBJECT (object)' failed
msgarea.show_all()
I have a Mac running 10.6.7, and I installed this script along with meld.
I cd to my project directory, and run git meld master..
The script returns "mktemp -d failed with exit code 256 at /Users/david/bin/git-meld.pl line 27."
I don't understand why this fails: mktemp -d works fine on the command line.
I modified the script to hardcode the temp directory as /Users//tmp" and the script worked fine.
Just thought you should know....
David
Thanks for git-meld. It's an amazing tool!
Would it be possible to get the diff of a single commit? For example:
git meld 3aed88f540c08b2fb854476f95d4db27d9600f79
Which would bring the diff of that exact commit?
Right now it shows the diff since that commit...
Thanks!
> git meld staging..master
... | tar -x -C "/tmp/git-meld.j7w7yR/master" failed with exit code -1 at /home/elfo/Program_Files/git-meld/git-meld.pl line 27
Maybe the problem are the capital letters in the path?
When I try to git-meld a commit that has thousands of files in it the safe_cmd()
call containing the git archive
shell command fails with an error == -1. I'm not sure what the exact problem is, because if I put the command that failed from the Perl script into a bash script and run it, it works.
But, if I change copy_file_names_tree()
to call git archive
with smaller batches of files it seems to work.
A patch follows; keep in mind that Perl is a non-native language to me, so it's probably less than idiomatic.
diff --git a/git-meld.pl b/git-meld.pl
index e581781..f98a2b6 100755
--- a/git-meld.pl
+++ b/git-meld.pl
@@ -146,8 +146,17 @@ sub copy_files_named_tree($$$) {
if (scalar @$file_list == 0) {
return;
}
- my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
- safe_cmd("cd \$(git rev-parse --show-toplevel) && git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+ #my $escaped_file_list = join(" ", map{shell_escape($_)} @$file_list);
+ #safe_cmd("cd \$(git rev-parse --show-toplevel) && git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+
+ safe_cmd("cd \$(git rev-parse --show-toplevel)");
+ my @flist = @$file_list;
+
+ while (scalar @flist != 0) {
+ my @sub_list = splice @flist, 0, 200;
+ my $escaped_file_list = join(" ", map{shell_escape($_)} @sub_list);
+ safe_cmd("git archive $tree $escaped_file_list | tar -x -C \"$out_dir\"");
+ }
}
# Links the files given as a list in the first argument from the working
Hi,
if i do :
git checkout test
git meld master..test
it'd be nice the "test" branch not be copied in a tmp dir,
so that it's possible to actually copy stuff from master branch into test branch.
just an idea...
If you rename the main executable from git-meld.pl
to git-meld
, then Git will automatically use it when you type git meld
. This simplifies installation, since then you can just drop the script anywhere on the PATH, rather than having to define an alias.
git help meld
and git meld --help
will also automatically run man git-meld
, which will work as expected if you create that man page.
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.
Also, something you might consider:
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
a little more flexible....
BTW - awesome script - exactly what I was looking for :)
From the git-rev-parse page under "Specifying Ranges", I should be able to use:
r1^!
to specify the same range as
r1^...r1
this works for git diff, but git meld fails with the following errors:
fatal: Not a valid object name
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
cd $(git rev-parse --show-toplevel) && git archive 302431cb^! "file1" "file2" | tar -x -C "/tmp/git-meld.ehuKeC/302431cb^!" failed with exit code 512 at /home/kabiblueline/Git/wmanley-git-meld-b6224ce/git-meld.pl line 27.
Hi,
At the first read of README I was not sure if git-meld will also apply changes for working dir. This is a great feature.
Maybe the usage line can be updated to:
git meld uses "git diff --name-only" to extract the files that have changed between the two commits and then makes a copy of these files into a temporary directory before invoking meld on these copies. At exit, files modified in the temporary directory for working_dir are applied to the actual working folder.
Thanks for the great tool!
i have this problem when i try to execute git meld
system(meld /var/folders/14/rwnx1k556dl95dht32psd3lh0000gn/T/git-meld.XXXXXX.rLZAVVgb/staging_area /var/folders/14/rwnx1k556dl95dht32psd3lh0000gn/T/git-meld.XXXXXX.rLZAVVgb/working_dir ) failed!
If folder name contains blank spaces, git-meld fails with:
sh: 1: cd: can't cd to /home/...
cd $(git rev-parse --show-toplevel) && git archive rosales ".gitignore" | tar -x -C "/tmp/git-meld.F8dhcE/..." failed with exit code 512 at .../git-meld line 27.
I think because dirname isn't escaped before "cd" to it (line 150).
safe_cmd("cd $(git rev-parse --show-toplevel) && git archive $tree $escaped_file_list | tar -x -C "$out_dir"");
Hi Will,
Thanks for the excellent utility. If you are interested I've posted instructions for use on Windows at
git meld master...
fails with a merge-base error. Instead it should be equivalent to:
git meld $(git merge-base master HEAD)
This is consistent with the behaviour of git diff
die ("system(" . @_ . ") failed!");
@_ is used in scalar context, only prints len of args
should be used in array context, ie
die "system(@_ ) failed!\n";
I want to meld a diff between my current repo and my origin after a fetch something like git diff master origin/master
Is this possible with git-meld?
It would be useful, if git-meld would handle any submodules (optionally?), too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.