summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2006-08-28Merge branch 'js/c-merge-recursive'Junio C Hamano
* js/c-merge-recursive: (21 commits) discard_cache(): discard index, even if no file was mmap()ed merge-recur: do not die unnecessarily merge-recur: try to merge older merge bases first merge-recur: if there is no common ancestor, fake empty one merge-recur: do not setenv("GIT_INDEX_FILE") merge-recur: do not call git-write-tree merge-recursive: fix rename handling .gitignore: git-merge-recur is a built file. merge-recur: virtual commits shall never be parsed merge-recur: use the unpack_trees() interface instead of exec()ing read-tree merge-recur: fix thinko in unique_path() Makefile: git-merge-recur depends on xdiff libraries. merge-recur: Explain why sha_eq() and struct stage_data cannot go merge-recur: Cleanup last mixedCase variables... merge-recur: Fix compiler warning with -pedantic merge-recur: Remove dead code merge-recur: Get rid of debug code merge-recur: Convert variable names to lower_case Cumulative update of merge-recursive in C recur vs recursive: help testing without touching too many stuff. ... This is an evil merge that removes TEST script from the toplevel.
2006-08-28Merge branch 'ts/daemon'Junio C Hamano
* ts/daemon: Added support for dropping privileges to git-daemon.
2006-08-28Merge branch 'jc/apply'Junio C Hamano
* jc/apply: git-apply --reject: finishing touches. apply --reject: count hunks starting from 1, not 0 git-apply --verbose git-apply --reject: send rejects to .rej files. git-apply --reject apply --reverse: tie it all together. diff.c: make binary patch reversible. builtin-apply --reverse: two bugfixes.
2006-08-27git-apply --reject: finishing touches.Junio C Hamano
After a failed "git am" attempt: git apply --reject --verbose .dotest/patch applies hunks that are applicable and leaves *.rej files the rejected hunks, and it reports what it is doing. With --index, files with a rejected hunk do not get their index entries updated at all, so "git diff" will show the hunks that successfully got applied. Without --verbose to remind the user that the patch updated some other paths cleanly, it is very easy to lose track of the status of the working tree, so --reject implies --verbose. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27git-reset: remove unused variableRene Scharfe
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27git-cherry: remove unused variableRene Scharfe
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Relative timestamps in git logLinus Torvalds
I noticed that I was looking at the kernel gitweb output at some point rather than just do "git log", simply because I liked seeing the simplified date-format, ie the "5 days ago" rather than a full date. This adds infrastructure to do that for "git log" too. It does NOT add the actual flag to enable it, though, so right now this patch is a no-op, but it should now be easy to add a command line flag (and possibly a config file option) to just turn on the "relative" date format. The exact cut-off points when it switches from days to weeks etc are totally arbitrary, but are picked somewhat to avoid the "1 weeks ago" thing (by making it show "10 days ago" rather than "1 week", or "70 minutes ago" rather than "1 hour ago"). [jc: with minor fix and tweak around "month" and "week" area.] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Add git-zip-treeRene Scharfe
In the Windows world ZIP files are better supported than tar files. Windows even includes built-in support for ZIP files nowadays. git-zip-tree is similar to git-tar-tree; it creates ZIP files out of git trees. It stores the commit ID (if available) in a ZIP file comment which can be extracted by unzip. There's still quite some room for improvement: this initial version supports no symlinks, calls write() way too often (three times per file) and there is no unit test. [jc: with a minor typefix to avoid void* arithmetic] Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27git-svn: stop repeatedly reusing the first commit message with dcommitEric Wong
Excessive use of global variables got me into trouble. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Use xrealloc instead of reallocJonas Fonseca
Change places that use realloc, without a proper error path, to instead use xrealloc. Drop an erroneous error path in the daemon code that used errno in the die message in favour of the simpler xrealloc. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Use PATH_MAX instead of MAXPATHLENJonas Fonseca
According to sys/paramh.h it's a "BSD name" for values defined in <limits.h>. Besides PATH_MAX seems to be more commonly used. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Convert unpack_entry_gently and friends to use offsets.Shawn Pearce
Change unpack_entry_gently and its helper functions to use offsets rather than addresses and left counts to supply pack position information. In most cases this makes the code easier to follow, and it reduces the number of local variables in a few functions. It also better prepares this code for mapping partial segments of packs and altering what regions of a pack are mapped while unpacking an entry. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Cleanup unpack_object_header to use only offsets.Shawn Pearce
If we're always incrementing both the offset and the pointer we aren't gaining anything by keeping both. Instead just use the offset since that's what we were given and what we are expected to return. Also using offset is likely to make it easier to remap the pack in the future should partial mapping of very large packs get implemented. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Cleanup unpack_entry_gently and friends to use type_name array.Shawn Pearce
[PATCH 3/5] Cleanup unpack_entry_gently and friends to use type_name array. This change allows combining all of the non-delta entries into a single case, as well as to remove an unnecessary local variable in unpack_entry_gently. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Reuse compression code in unpack_compressed_entry.Shawn Pearce
[PATCH 2/5] Reuse compression code in unpack_compressed_entry. This cleans up the code by reusing a perfectly good decompression implementation at the expense of 1 extra byte of memory allocated in temporary memory while the delta is being decompressed and applied to the base. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-27Reorganize/rename unpack_non_delta_entry to unpack_compressed_entry.Shawn Pearce
This function was moved above unpack_delta_entry so we can call it from within unpack_delta_entry without a forward declaration. This change looks worse than it is. Its really just a relocation of unpack_non_delta_entry to earlier in the file and renaming the function to unpack_compressed_entry. No other changes were made. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26Merge branch 'gl/cleanup'Junio C Hamano
* gl/cleanup: Convert memset(hash,0,20) to hashclr(hash). Convert memcpy(a,b,20) to hashcpy(a,b).
2006-08-26gitweb: git_annotate didn't expect negative numeric timezoneJakub Narebski
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-svn: add the 'dcommit' commandEric Wong
This is a high-level wrapper around the 'commit-diff' command and used to produce cleaner history against the mirrored repository through rebase/reset usage. It's basically a more polished version of this: for i in `git rev-list --no-merges remotes/git-svn..HEAD | tac`; do git-svn commit-diff $i~1 $i done git reset --hard remotes/git-svn Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-svn: recommend rebase for syncing against an SVN repoEric Wong
Does this make sense to other git-svn users out there? pull can give funky history unless you understand how git-svn works internally, which users should not be expected to do. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-svn: establish new connections on commit after forkEric Wong
SVN seems to have a problem with https:// repositories from time-to-time when doing multiple, sequential commits. This problem is not consistently reproducible without the patch, but it should go away entirely with this patch... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26describe: fix off-by-one error in --abbrev=40 handlingJonas Fonseca
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-svn(1): improve asciidoc markupJonas Fonseca
Use list continuation to have better wrapping. This accounts for most of the changes because it reindents a lot of text without applying other changes. Use cross-referencing for interlinking and the gitlink macro for pointing to other tools in the git suite. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitview.txt: improve asciidoc markupJonas Fonseca
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git(7): put the synopsis in a verse style paragraphJonas Fonseca
... so it wraps properly in small terminals. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26gitk(1): expand the manpage to look less like a templateJonas Fonseca
Add a short description and document a few selected options additionally to the different "entities" in the standard calling convention. Advertise other git repository browsers. Lastly, climb Mount Ego. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-blame(1): mention options in the synopsis and advertise pickaxeJonas Fonseca
Inspired by the cvs annotate documentation improve and expand the man page to also mention the limitations of file annotations. Since people coming from the SVN/CVS world might first look here, also briefly advertise how the pickaxe interface makes it easy to go beyond these limitation. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-ls-remote(1): document --upload-packJonas Fonseca
... and mention that '.' will list the local repo references. Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26git-apply(1): document missing options and improve existing onesJonas Fonseca
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24update-index -gJunio C Hamano
I often find myself typing this but the common abbreviation "g" for "again" has not been supported so far for some unknown reason. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24n is in fact unused, and is later shadowed.Pierre Habouzit
date.c::approxidate_alpha() counts the number of alphabets while moving the pointer but does not use the count. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24use name[len] in switch directly, instead of creating a shadowed variable.Pierre Habouzit
builtin-apply.c defines a local variable 'c' which is used only once and then later gets shadowed by another instance of 'c'. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24builtin-grep.c: remove unused debugging piece.Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24remove ugly shadowing of loop indexes in subloops.Pierre Habouzit
builtin-mv.c and git.c has a nested loop that is governed by a variable 'i', but they shadow it with another instance of 'i'. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24missing 'static' keywordsPierre Habouzit
builtin-tar-tree.c::git_tar_config() and http-push.c::add_one_object() are not used outside their own files. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24git_dir holds pointers to local strings, hence MUST be const.Pierre Habouzit
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-24avoid to use error that shadows the function name, use err instead.Pierre Habouzit
builtin-apply.c and builtin-push.c uses a local variable called 'error' which shadows the error() function. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Convert memset(hash,0,20) to hashclr(hash).Junio C Hamano
In the same spirit as hashcmp() and hashcpy(). Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Convert memcpy(a,b,20) to hashcpy(a,b).Shawn Pearce
This abstracts away the size of the hash values when copying them from memory location to memory location, much as the introduction of hashcmp abstracted away hash value comparsion. A few call sites were using char* rather than unsigned char* so I added the cast rather than open hashcpy to be void*. This is a reasonable tradeoff as most call sites already use unsigned char* and the existing hashcmp is also declared to be unsigned char*. [jc: Splitted the patch to "master" part, to be followed by a patch for merge-recursive.c which is not in "master" yet. Fixed the cast in the latter hunk to combine-diff.c which was wrong in the original. Also converted ones left-over in combine-diff.c, diff-lib.c and upload-pack.c ] Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23Fix a comparison bug in diff-delta.cPierre Habouzit
(1 << i) < hspace is compared in the `int` space rather that in the unsigned one. the result will be wrong if hspace is between 0x40000000 and 0x80000000. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-23git-send-email: Don't set author_not_sender from Cc: linesHaavard Skinnemoen
When an mbox-style patch contains a Cc: line in the header, git-send-email will check the address against the sender specified on the command line. If they don't match, sender_not_author will be set to the address obtained from the Cc line. When this happens, git-send-email inserts a From: line at the beginning of the message body with the address obtained from the Cc line in the header, and the sender might be accused of forging patch authors. This patch fixes this by only updating sender_not_author when processing From: lines, not when processing Cc: lines. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22Added support for dropping privileges to git-daemon.Tilman Sauerbeck
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22apply --reject: count hunks starting from 1, not 0Junio C Hamano
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22Remove unnecessary forward declaration of unpack_entry.Shawn Pearce
This declaration probably used to be necessary but the code has been refactored since to use unpack_entry_gently instead. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22Verify we know how to read a pack before trying to using it.Shawn Pearce
If the pack format were to ever change or be extended in the future there is no assurance that just because the pack file lives in objects/pack and doesn't end in .idx that we can read and decompress its contents properly. If we encounter what we think is a pack file and it isn't or we don't recognize its version then die and suggest to the user that they upgrade to a newer version of GIT which can handle that pack file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22Add write_or_die(), a helper functionRene Scharfe
The little helper write_or_die() won't come back with bad news about full disks or broken pipes. It either succeeds or terminates the program, making additional error handling unnecessary. This patch adds the new function and uses it to replace two similar ones (the one in tar-tree originally has been copied from cat-file btw.). I chose to add the fd parameter which both lacked to make write_or_die() just as flexible as write() and thus suitable for lib-ification. There is a regression: error messages emitted by this function don't show the program name, while the replaced two functions did. That's acceptable, I think; a lot of other functions do the same. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-22Axe the last entRene Scharfe
In the name of Standardization, this cleanses the last usage string of mystical creatures. But they still dwell deep within the source and in some debug messages, it is said. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-21Merge branch 'maint'Junio C Hamano
* maint: builtin-mv: readability patch git-mv: fix off-by-one error git-mv: special case destination "."
2006-08-21builtin-mv: readability patchJohannes Schindelin
The old version was not liked at all. This is hopefully better. Oh, and it gets rid of the goto. Note that it does not change any functionality. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-21git-mv: fix off-by-one errorJohannes Schindelin
Embarassing. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>