summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2005-04-29[PATCH] GIT: Create tar archives of tree on the flyLibravatar Rene Scharfe2-16/+54
Write commit ID to global extended pax header at the beginning of the tar file, if possible. get-tar-commit-id.c is an example program to get the ID back out of such a tar archive. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-29[PATCH] leftover bits for git renameLibravatar Junio C Hamano3-5/+5
Linus said: "Let's see what else I forgot.." Not that many, but here they are. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-29[PATCH] Makefile: The big git command renaming fallout fix.Libravatar Junio C Hamano1-2/+1
Here is another. This one belongs to a clean-up category. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-29Update the merge scripts for the big git rename.Libravatar Linus Torvalds2-18/+18
Let's see what else I forgot..
2005-04-29[PATCH] The big git command renaming fallout fix.Libravatar Junio C Hamano1-1/+1
This fixes the git-export which calls diff-tree. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-29Rename git core commands to be "git-xxxx" to avoid name clashes.Libravatar Linus Torvalds4-38/+44
This also regularizes the make. The source files themselves don't get the "git-" prefix, because that's just inconvenient. So instead we just make the rule that "git-xxxx" depends on "xxxx.c", and do that for all the core programs (ie the old "git-mktag.c" got renamed to just "mktag.c" to match everything else). And "show-diff" got renamed to "git-diff-files" while at it, since that's what it really should be to match the other git-diff-xxx cases.
2005-04-29[PATCH] GIT: Honour SHA1_FILE_DIRECTORY env var in git-pull-scriptLibravatar Rene Scharfe1-1/+1
If you set SHA1_FILE_DIRECTORY to something else than .git/objects git-pull-script will store the fetched files in a location the rest of the tools does not expect. git-prune-script also ignores this setting, but I think this is good, because pruning a shared tree to fit a single project means throwing away a lot of useful data. :-) Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Use read_object_with_reference() in tar-treeLibravatar Rene Scharfe1-29/+25
This patch replaces the usage of read_tree_with_tree_or_commit_sha1() with read_object_with_reference() in tar-tree. As a result the code that tries to figure out the commit time doesn't need to open the commit object 'by hand' any more. Signed-off-by: Rene Scharfe <lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Rename and extend read_tree_with_tree_or_commit_sha1Libravatar Junio C Hamano7-41/+47
This patch renames read_tree_with_tree_or_commit_sha1() to read_object_with_reference() and extends it to automatically dereference not just "commit" objects but "tag" objects. With this patch, you can say e.g.: ls-tree $tag read-tree -m $(merge-base $tag $HEAD) $tag $HEAD diff-cache $tag diff-tree $tag $HEAD Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] add short options to show-filesLibravatar Nicolas Pitre1-37/+16
The show-files long options are cumbersome to type. This patch adds equivalent short options. Also add missing "unmerged" to usage string. Finally reduce the number of lines for argument parsing in half. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] diff-tree does not need -r in git-export.cLibravatar Junio C Hamano1-1/+1
No need to pass -r anymore, since diff-tree -p implies recursive behaviour these days. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] create tar archives of tree on the flyLibravatar Rene Scharfe2-1/+364
This is an improved version of tar-tree, a streaming archive creator for GIT. The major added feature is blocking; all write(2) calls now have a size of 10240, just as GNU tar (and tape drives) likes them. The buffering overhead does not seem to degrade performance because most files in the repositories I tested this with are smaller than 10KB, so we need fewer system calls. File names are still restricted to 500 bytes and the archive format currently only allows for files up to 8GB. Both restrictions can be lifted if need be with more pax extended headers. The archive format used is the pax interchange format, i.e. POSIX tar format. It can be read by (and created with) GNU tar. If I read the specs correctly tar-tree should now be standards compliant (modulo bugs). Because it streams the archive (think ls-tree merged with cat-file), tar-tree doesn't need to create any temporary files. That makes it quite fast. It accepts tree IDs and commit IDs as first parameter. In the latter case tar-tree tries to get the commit date out of the committer line. Else all files in the archive are time-stamped with the current time. An optional second parameter is used as a path prefix for all files in the archive. Example: $ tar-tree a2755a80f40e5794ddc20e00f781af9d6320fafb \ linux-2.6.12-rc3 | bzip9 -9 > linux-2.6.12-rc3.tar.bz2 Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Give show-files the ability to process exclusion pattern.Libravatar Nicolas Pitre1-8/+97
This can be used with the famous dontdiff file as follows to find out about uncommitted files just like dontdiff is used with the diff command: show-files --others --exclude-from=dontdiff and the exclude list can be reversed with the --ignore switch. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] diff-cache.c compilation warning fix.Libravatar Junio C Hamano1-2/+2
Nobody uses return value from show_new_file() function but it is defined as returning int and falls off at the end without returning. Make it void. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] diff.c: clean temporary filesLibravatar Junio C Hamano1-5/+24
When diff-cache -p and friends are interrupted, they can leave their temporary files behind. Also when the external diff program is killed instead of exiting (this usually happens when piping the output to a pager, which can cause SIGPIPE when the user quits viewing the diff early), they incorrectly died without cleaning their temporary file. This fixes these problems. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] diff-tree-helper: do not report unmerged path outside specification.Libravatar Junio C Hamano1-60/+50
My bad. diff-tree-helper reports all unmerged paths even when the command line specifies to filter the paths. This patch fixes it. Also reverse-diff option was left out during the last round, which this patch restores as well. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Make diff-cache and friends output more cg-patch friendly.Libravatar Junio C Hamano1-20/+36
This changes the way the default arguments to diff are built when diff-cache and friends are invoked with -p and there is no GIT_EXTERNAL_DIFF environment variable. It attempts to be more cg-patch friendly by: - Showing diffs against /dev/null to denote added or removed files; - Showing file modes for existing files as a comment after the diff label. Unfortunately with this change GIT_DIFF_CMD customization cannot be supported easily anymore, so it has been dropped. GIT_DIFF_OPTS customization to change diffs from unified to context is still there, though. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28Fix up recent object model cleanupsLibravatar Linus Torvalds2-1/+4
Make sure the Makefile knows about the object header dependencies, and add declarations for tag lookup/parsing.
2005-04-28[PATCH] Rework fsck-cache to use parse_object()Libravatar Daniel Barkalow1-87/+34
With support for parse_object() and tags in the core, fsck_cache can just call them, and can be simplified a bit. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Add function to parse an object of unspecified type (take 2)Libravatar Daniel Barkalow2-0/+43
This adds a function that parses an object from the database when we have to look up its actual type. It also checks the hash of the file, due to its heritage as part of fsck-cache. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Add tag header/parser to libraryLibravatar Daniel Barkalow3-1/+89
This adds preliminary support for tags in the library. It doesn't even store the signature, however, let alone provide any way of checking it. Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-28[PATCH] Mark blobs as parsed when they're actually parsedLibravatar Daniel Barkalow2-1/+21
This eliminates the special case for blobs versus other types of objects. Now the scheme is entirely regular and I won't introduce stupid bugs. (And fsck-cache doesn't have to do the do-nothing parse) Signed-Off-By: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] diff-tree -p implies diff-tree -p -rLibravatar Junio C Hamano1-1/+1
This makes diff-tree -p imply recursive behaviour. Other commands in the family always takes a flat universe view so this is not even needed. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Use diff-tree -p -r instead of "git diff" in git-export.Libravatar Junio C Hamano1-1/+1
Now diff-tree can produce patch itself, there is no reason to depend on Cogito to show diff in the git-export output anymore. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Make -s flag to show-diff a no-op.Libravatar Junio C Hamano1-9/+9
With the recent "no-patch-by-default" change, the -s flag to the show-diff command (and silent variable in the show-diff.c) became meaningless. This deprecates it. Cogito uses "show-diff -s" for the purpose of "I do not want the patch text. I just want to know if something has potentially changed, in which case I know you will have some output. I'll run update-cache --refresh if you say something", so we cannot barf on seeing -s on our command line yet. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Fix up <sys/socket.h> include dependencyLibravatar Andreas Gal1-0/+1
This makes rsh.c compile on Darwin/MacOSX (and might possibly help on some Linux distributions too). sys/socket.h needs sys/types.h Signed-off-by: Andreas Gal <gal@uci.edu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27diff.c: don't add extra '/' to pathnameLibravatar Linus Torvalds1-2/+0
The "base" string already contains any finishing "/", so the way to get the full pathname is to just concatenate the base and path directly, with no extra slashes in between.
2005-04-27diff-cache: handle modified new files correctlyLibravatar Linus Torvalds1-18/+44
Junio pointed out that diff-cache didn't handle the case of a new file that was different from its index entry correctly. It needs to check the working copy the same way the modified file case did.
2005-04-27[PATCH] Teach diff-tree-helper to handle unmerged paths.Libravatar Junio C Hamano1-1/+1
This teaches diff-tree-helper to call diff_unmerge() so that it can report unmerged paths to GIT_EXTERNAL_DIFF, instead of consuming it on its own. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Add -p (patch) to diff-cache.Libravatar Junio C Hamano1-9/+28
This uses the reworked diff interface to generate patches directly out of diff-cache when -p is specified. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Add -p (patch) to diff-tree.Libravatar Junio C Hamano1-9/+26
This uses the reworked diff interface to generate patches directly out of diff-tree when -p is specified. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Reactivate show-diff patch generationLibravatar Junio C Hamano1-14/+42
This uses the reworked diff interface to generate patches directly out of show-diff when -p is specified. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-27[PATCH] Reworked external diff interface.Libravatar Junio C Hamano2-40/+72
This introduces three public functions for diff-cache and friends can use to call out to the GIT_EXTERNAL_DIFF program when they wish to. A normal "add/remove/change" entry is turned into 7-parameter process invocation of GIT_EXTERNAL_DIFF program as before. In addition, the program can now be called with a single parameter when diff-cache and friends want to report an unmerged path. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26Allow writing to the private index file mapping.Libravatar Linus Torvalds1-1/+1
We now modify the in-memory copy of the index file in "diff-cache", so we need to add PROT_WRITE.
2005-04-26diff-cache: fix handling of unmerged files.Libravatar Linus Torvalds1-22/+39
We've always warned about them properly, but we would then do the wrong thing if that filename existed in the tree we were comparing against (we'd think the file has been deleted, because we forgot about the unmerged cases).
2005-04-26diff-cache.c: use the "U <pathname>" format for unmerged entries.Libravatar Linus Torvalds1-1/+1
This makes it match "show-diff" behaviour.
2005-04-26[PATCH] diff-cache/tree compatible output for show-diff (take 2).Libravatar Junio C Hamano1-9/+18
This makes diff-tree-helper handle ("warn about") unmerged path entries U <path> <record-terminator> This is emitted once per unmerged path, no matter how many unmerged stages there are. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26show-diff: don't print out the full "ce" format for unmerged filesLibravatar Linus Torvalds1-1/+1
It really doesn't make sense, since there are potentially _many_ different cache entries for an unmerged file. So just do the "U pathname" thing.
2005-04-26show-diff: match diff-tree and diff-cache outputLibravatar Linus Torvalds1-31/+32
You'll need "diff-tree-helper" to show the full diff, but Junio is dead set on adding a "-p" argument to all three to avoid it. That's next..
2005-04-26git-pull-script: do automatic mergesLibravatar Linus Torvalds1-3/+11
When the trivial "read-tree" merge fails, fall back on the (equally trivial) automatic merge script instead of forcing the user to do it by hand. When _that_ fails, you get to do a manual merge.
2005-04-26[PATCH] introduce xmalloc and xreallocLibravatar Christopher Li18-41/+54
Introduce xmalloc and xrealloc to die gracefully with a descriptive message when out of memory, rather than taking a SIGSEGV. Signed-off-by: Christopher Li<chrislgit@chrisli.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26update-cache: remove index lock file on SIGINTLibravatar Linus Torvalds1-0/+7
This makes it a lot more pleasant to use when you interrupt a long-running operation.
2005-04-26[PATCH] diff-cache bugletLibravatar Junio C Hamano1-1/+1
diff-cache attempts to first remove all merge entries before letting the diff_cache() do its work, but it incorrectly stops after the first merge-entry it finds. Fix by just replacing the "break" with a "continue". Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-26[PATCH] Diff-tree-helper take two.Libravatar Junio C Hamano4-270/+271
This reworks the diff-tree-helper and show-diff to further make external diff command interface simpler. These commands now honor GIT_EXTERNAL_DIFF environment variable which can point at an arbitrary program that takes 7 parameters: name file1 file1-sha1 file1-mode file2 file2-sha1 file2-mode The parameters for an external diff command are as follows: name this invocation of the command is to emit diff for the named cache/tree entry. file1 pathname that holds the contents of the first file. This can be a file inside the working tree, or a temporary file created from the blob object, or /dev/null. The command should not attempt to unlink it -- the temporary is unlinked by the caller. file1-sha1 sha1 hash if file1 is a blob object, or "." otherwise. file1-mode mode bits for file1, or "." for a deleted file. If GIT_EXTERNAL_DIFF environment variable is not set, the default is to invoke diff with the set of parameters old show-diff used to use. This built-in implementation honors the GIT_DIFF_CMD and GIT_DIFF_OPTS environment variables as before. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-25[PATCH] Introduce diff-tree-helper.Libravatar Junio C Hamano4-1/+363
This patch introduces a new program, diff-tree-helper. It reads output from diff-cache and diff-tree, and produces a patch file. The diff format customization can be done the same way the show-diff uses; the same external diff interface introduced by the previous patch to drive diff from show-diff is used so this is not surprising. It is used like the following examples: $ diff-cache --cached -z <tree> | diff-tree-helper -z -R paths... $ diff-tree -r -z <tree1> <tree2> | diff-tree-helper -z paths... - As usual, the use of the -z flag is recommended in the script to pass NUL-terminated filenames through the pipe between commands. - The -R flag is used to generate reverse diff. It does not matter for diff-tree case, but it is sometimes useful to get a patch in the desired direction out of diff-cache. - The paths parameters are used to restrict the paths that appears in the output. Again this is useful to use with diff-cache, which, unlike diff-tree, does not take such paths restriction parameters. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-25[PATCH] Split external diff command interface to a separate file.Libravatar Junio C Hamano4-98/+130
With this patch, the non-core'ish part of show-diff command that invokes an external "diff" comand to obtain patches is split into a separate file. The next patch will introduce a new command, diff-tree-helper, which uses this common diff interface to format diff-tree and diff-cache output into a patch form. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-25fsck-cache: show root objects only with "--root"Libravatar Linus Torvalds1-1/+6
This makes the default fsck behaviour be quiet for a repository that doesn't have any problems. Which is good.
2005-04-25fsck-cache: only show tags if asked to do so with "--tags"Libravatar Linus Torvalds1-5/+25
Normally we don't care, we just check them for being valid tag objects.
2005-04-25Add the git-*-script files to the installLibravatar Linus Torvalds1-2/+3
2005-04-25Add example "git-tag-script" to show how to create signed tag objects.Libravatar Linus Torvalds1-0/+8