summaryrefslogtreecommitdiff
path: root/show-diff.c
AgeCommit message (Collapse)Author
2005-04-17[PATCH] show-diff.c: do not include unused header fileJunio C Hamano
This is my bad. I added #include <ctype.h> to the file, which I ended up not using and failed to remove it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] Do not run useless show-diff on unmerged paths repeatedly.Junio C Hamano
When run on unmerged dircache, show-diff compares the working file with each non-empty stage for that path. Two out of three times, this is not very helpful. This patch makes it report the unmergedness only once per each path and avoids running the actual diff. Upper layer SCMs like Cogito are expected to find out mode/SHA1 for each stage by using "show-files --stage" and run the diff itself. This would result in more sensible diffs. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] show-diff style fix.Junio C Hamano
This fixes some stylistic problems introduced by my previous set of patches. I'll be sending my last patch to show-diff next, which depends on this cleanup. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] Rename confusing variable in show-diffJunio C Hamano
The show-diff command uses a variable "new" but it is always used to point at the original data recorded in the dircache before the user started editing in the working file. Rename it to "old" to avoid confusion. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] show-diff shell safetyJunio C Hamano
The command line for running "diff" command is built without taking shell metacharacters into account. A malicious dircache entry "foo 2>bar" (yes, a filename with space) would result in creating a file called "bar" with the error message "diff: foo: No such file or directory" in it. This is not just a user screwing over himself. Such a dircache can be created as a result of a merge with tree from others. Here is a fix. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] show-diff -z option for machine readable output.Junio C Hamano
This patch adds the -z option to the show-diff command, primarily for use by scripts. The information emitted is similar to that of -q option, but in a more machine readable form. Records are terminated with NUL instead of LF, so that the scripts can deal with pathnames with embedded newlines. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] Optionally tell show-diff to show only named filesJunio C Hamano
SCMs have ways to say "I want diff only this particular file", or "I want diff files under this directory". This patch teaches show-diff to do something similar. Without command line arguments, it still examines everything in the dircache as before. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-16Simplify show-diff cache entry name handling.Linus Torvalds
The cache-entry names are all proper strings, no need to worry about their length.
2005-04-15[PATCH] Add "-q" option to show-diff.cJunio C Hamano
This adds the '-q' option for show-diff.c to squelch complaints for missing files. It is handy if you want to run it in the merge temporary directory after running merge-trees with its minimum checkout mode, which is the default, because you would not find any files other than the ones that needs human validation after the merge there. It also fixes the argument parsing bug Paul Mackerras noticed in <16991.42305.118284.139777@cargo.ozlabs.ibm.com> but slightly differently. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-15Convert the index file reading/writing to use network byte order.Linus Torvalds
This allows using a git tree over NFS with different byte order, and makes it possible to just copy a fully populated repository and have the end result immediately usable (needing just a refresh to update the stat information).
2005-04-13[PATCH] Whitespace FixesIngo Molnar
Trivial whitespace fixes. From: Ingo Molnar <mingo@elte.hu> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-04-13[PATCH] Correct show-diff output for deleted filesPetr Baudis
My convention is that contrary to files trimmed to zero size, deleted files always go to /dev/null. This patch turns show-diff to abide this. Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-04-13[PATCH] Silent flag for show-diffPetr Baudis
This patch adds a -s flag for show-diff, which will surpress the actual diffing. This is useful for my scripts when they just want to see what needs to be updated in the cache. Signed-off-by: Petr Baudis <pasky@ucw.cz>
2005-04-12[PATCH] show-diff show deleted files as diff as well.Christopher Li
The ideas is that using the show-diff to generate the patch including deleted and new file (in the next patch). So we don't have to do the temp new file diff dance on the script. The cache index now contain enough information to generate the whole patch. So the GIT SCM don't need separate command for check out file to edit or delete. Just do the edit and remove and GIT will generate the correct patch. It still require tell GIT to add new files.
2005-04-12Remove the annoying "ok" printout from show-diff.Linus Torvalds
It used to be useful before I wrote "show-files", so that show-diff would also tell what the cached files were. Now it's just annoying.
2005-04-09Make the cache stat information comparator public.Linus Torvalds
Like the cache filename finder, it's a generically useful function, rather than something specific to the current "show-diff" thing.
2005-04-08Use "-Wall -O2" for the compiler to get more warnings.Linus Torvalds
And fix up the warnings that it pointed out. Let's keep the tree clean from early on. Not that the code is very beautiful anyway ;)
2005-04-07Add copyright notices.Linus Torvalds
The tool interface sucks (especially "committing" information, which is just me doing everything by hand from the command line), but I think this is in theory actually a viable way of describing the world. So copyright it.
2005-04-07Initial revision of "git", the information manager from hellLinus Torvalds