I have modified a third party bundle and I want to know all changes I've done.
What linux command can give me that? I guess should use diff command, but how?
Assuming you've got the original source in src/ and your modified version in my_src/, you can use diff with the --recursive switch:
diff --recursive src my_src
Try one of the GUI replacements of diff like KDiff3.
UPDATE
You might want to try and take a look at mtree.
Related
When doing "diff -bBupwr" of two directories, dir and dir.orig to capture the differences, the util doesn't include files that exist only in dir, it only reports that e.g. dir/app.c exists only in dir/, but I would like it to be added in a resulting diff file, so that it could be applied as a patch.
I checked 'man diff' but no clues was found. I'd appreciate helpful advises for this. Thanks.
Use the option -N. The man page says:
-N, --new-file
treat absent files as empty
After a lot of search i could see that meId is a good diff tool for comparision in linux
I would like to use the meId for displaying the svn diff
I am new to linux as well as SVN
I just downloaded the meId and placed it on my desktop i am not sure what to do next ?
i could see 'svn diff -r 2165:2182 --diff-cmd meld' is used to do the trick
but i am not sure how to do this
Can some one guide me to get the diff of svn displayed in meID
Any help for this is greatly appreciated ..
You need to create a wrapper script as described here: SVN documentation
In the Meld wiki you can find a wrapper script used to merge with Meld: Meld wiki
You can find the command line usage of Meld in the documentation.
How do I get a GUI-based merge tool to work with command line SVN in linux? I understand that there are many options like meld, svn Diff, etc. out there. All of them require a helper script to allow svn to invoke the external program during conflict resolution. I followed the instructions given here and the nice svn manual with meld.
But in all cases, when I get to the merge conflict and type 'l' to invoke the external tool, I get an error: The external merge tool exited with exit code 255
I'm fairly certain I'm missing some key thing here. ITs too much of a coincidence for so many different solutions to fail. Would appreciate any solution or pointers to the problem.
Thanks!
Also make sure that the path in your config is absolute. It should be the same path you see when you run a pwd command from that directory. No aliases or relative paths. So if your username is foo you would replace this line:
Add this below it:
merge-tool-cmd = ~/bin/svn-merge-meld
With
Add this below it:
merge-tool-cmd = /Users/foo/bin/svn-merge-meld
You may not have the correct permissions on the wrapper script. Try something like this:
sudo chmod +x /usr/local/bin/mergewrap.py
I've found several wrapper scripts for vimdiff or meld which seem to pass the wrong number of arguments. Unless I've misunderstood the rather terse documentation about the commandline parameters, they only take 2 or 3 filenames. This may also cause the script to fail with an error.
Not sure what to google for this, so excuse me if the question is stupid.
I have a Makefile rule that depends on several files. When any of them changes, I want make to invoke a program and pass to it the list of the changed files as command line arguments. Ideally, I want something like this:
myfiles: file1.txt file2.txt file3.txt
my_command $(CHANGED_DEPENDENCIES)
For example, if I changed file1.txt and file2.txt, I'd expect make to invoke my_command file1.txt file2.txt
How do I accomplish that?
Thanks.
Use an automatic variable:
$?
The names of all the dependencies that are newer than the target, with spaces between them. For dependencies which are archive members, only the member named is used (see section Using make to Update Archive Files).
See gnu make
Patches are frequently released for my CMS system. I want to be able to extract the tar file containing the patched files for the latest version directly over the full version on my development system. When I extract a tar file it puts it into a folder with the name of the tar file. That leaves me to manually copy each file over to the main directory. Is there a way to force the tar to extract the files into the current directory and overwrite any files that have the same filenames? Any directories that already exist should not be overwritten, but merged...
Is this possible? If so, what is the command?
Check out the --strip-components (or --strippath) argument to tar, might be what you're looking for.
EDIT: you might want to throw --keep-newer into the mix, so any locally modified files aren't overwritten. And I would suggest testing new releases on a development server, then using rsync or subversion to carry over the changes.
I tried getting --strip-components to work and, while I didn't try that hard, I didn't get it working. It kept flattening the directory structure. In searching, I came across the following command that seems to do exactly what I want:
pax -r -f patch.tar -s'/patch///'
It's not tar, but hey, it works... Replace the words "patch" with whatever your tar file name is.
The option '--strip-components' allows you to trim parts of the embedded filenames. With that it is possible to do what you want.
For more help check out http://www.gnu.org/software/tar/manual/html_section/transform.html
I have just done:
tar -xzf patch.tar.gz
And it overwrites all the files that the patch contains.
I.e., if the patch was created for the contents of the app folder, I would extract it there. Results would be like this:
tar.gz contains: oldfolder/someoldfile.txt, oldfolder/newfolder/newfile.txt
before app looks like:
app/oldfolder/someoldfile.txt
Afterwards, app looks like
app/oldfolder/someoldfile.txt
oldfolder/newfolder/newfile.txt
And the "someoldfile.txt" is actually updated to what was in the tar.gz
Maybe this doesn't work with regular tar, only tar.gz. But I doubt it. I think it should work for everything, as long as user has write permissions.