summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2006-06-21Merge branch 'master' into nextLibravatar Junio C Hamano2-26/+35
* master: checkout -f: do not leave untracked working tree files. Log peer address when git-daemon called from inetd
2006-06-20checkout -f: do not leave untracked working tree files.Libravatar Junio C Hamano1-2/+1
Earlier we did not consider untracked working tree files "precious", but we have always considered them fair game to clobber. These days, branch switching by read-tree is more careful and tries to protect untracked working tree files. This caused the following workflow to stop working: git checkout one-branch-with-file-F git checkout -f another-without-file-F git pull . one-branch-with-file-F Because the second checkout leaves F from the previous state as untracked file in the working tree, the merge would fail, trying to protect F from being clobbered. This changes "git checkout -f" to remove working tree files that are known to git in the switched-from state but do not exist in the switched-to state, borrowing the same logic from "reset --hard". Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20Log peer address when git-daemon called from inetdLibravatar David Woodhouse1-24/+34
When we run git-daemon from inetd, even with the --verbose option, it doesn't log the peer address. That logic was only in the standalone daemon code -- move it to the execute() function instead. Tested with both IPv6 and Legacy IP clients, in both inetd and daemon mode. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Jon Loeliger <jdl@jdl.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20Merge branch 'jn/web' into nextLibravatar Junio C Hamano2-154/+252
* jn/web: gitweb: style done with stylesheet gitweb: A couple of page title tweaking
2006-06-20gitweb: style done with stylesheetLibravatar Jakub Narebski2-154/+246
Replace (almost) all 'style' attributes with 'class' attribute and adding rule to CSS file. Some tables use CSS for styling instead of legacy styling attributes. [jc: too many rejects -- hand fixed and reindented]
2006-06-20gitweb: A couple of page title tweakingLibravatar Jakub Narebski1-0/+6
[jc: the e-mailed patch did not apply, so I had to guess but I think I got the result right.]
2006-06-20Merge branch 'jn/web' into nextLibravatar Junio C Hamano1-1/+1
2006-06-20Fix: Support for the standard mime.types map in gitwebLibravatar Jakub Narebski1-1/+1
Temporary fix: commented out offending line in mimetype_guess. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20Merge branch 'master' into nextLibravatar Junio C Hamano3-6/+41
2006-06-20Merge branch 'jn/web' into nextLibravatar Junio C Hamano1-2/+2
2006-06-20Merge branch 'pb/config' into nextLibravatar Junio C Hamano2-3/+1
2006-06-20git-svn: fix --rmdir when using SVN:: librariesLibravatar Eric Wong3-6/+41
When tracking directories with nearly all of its files at the most nested levels, --rmdir would accidentally go too far when deleting. Of course, we'll add a test for this condition, too. Makefile: automatically run new tests as they appear in t/ Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20git_config: access() returns 0 on success, not > 0Libravatar Johannes Schindelin1-1/+1
Another late-night bug. Sorry again. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20repo-config: Fix late-night bugLibravatar Johannes Schindelin1-2/+0
This bug was hidden by the "future-proofing" of the test. Sigh. When neither GIT_CONFIG nor GIT_CONFIG_LOCAL is set, do not use NULL, but $GIT_DIR/config. Instead of using $GIT_DIR/config when only GIT_CONFIG_LOCAL is set. Sorry. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19gitweb: add type="text/css" to stylesheet linkLibravatar Jakub Narebski1-2/+2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Merge branch 'jc/waitpid' into nextLibravatar Junio C Hamano3-0/+15
* jc/waitpid: Restore SIGCHLD to SIG_DFL where we care about waitpid().
2006-06-19Merge branch 'lt/objlist' into nextLibravatar Junio C Hamano24-148/+241
* lt/objlist: Add "named object array" concept xdiff: minor changes to match libxdiff-0.21 fix rfc2047 formatter. Fix t8001-annotate and t8002-blame for ActiveState Perl Add specialized object allocator
2006-06-19Merge branches 'js/lsfix', 'pb/config' and 'jn/web' into nextLibravatar Junio C Hamano7-71/+319
* js/lsfix: Initialize lock_file struct to all zero. * pb/config: Read configuration also from $HOME/.gitconfig Fix setting config variables with an alternative GIT_CONFIG * jn/web: Make CSS file gitweb/gitweb.css more readable
2006-06-19Add "named object array" conceptLibravatar Linus Torvalds14-131/+151
We've had this notion of a "object_list" for a long time, which eventually grew a "name" member because some users (notably git-rev-list) wanted to name each object as it is generated. That object_list is great for some things, but it isn't all that wonderful for others, and the "name" member is generally not used by everybody. This patch splits the users of the object_list array up into two: the traditional list users, who want the list-like format, and who don't actually use or want the name. And another class of users that really used the list as an extensible array, and generally wanted to name the objects. The patch is fairly straightforward, but it's also biggish. Most of it really just cleans things up: switching the revision parsing and listing over to the array makes things like the builtin-diff usage much simpler (we now see exactly how many members the array has, and we don't get the objects reversed from the order they were on the command line). One of the main reasons for doing this at all is that the malloc overhead of the simple object list was actually pretty high, and the array is just a lot denser. So this patch brings down memory usage by git-rev-list by just under 3% (on top of all the other memory use optimizations) on the mozilla archive. It does add more lines than it removes, and more importantly, it adds a whole new infrastructure for maintaining lists of objects, but on the other hand, the new dynamic array code is pretty obvious. The change to builtin-diff-tree.c shows a fairly good example of why an array interface is sometimes more natural, and just much simpler for everybody. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Restore SIGCHLD to SIG_DFL where we care about waitpid().Libravatar Junio C Hamano3-0/+15
It was reported that under one implementation of socks client "git clone" fails with "error: waitpid failed (No child processes)", because "git" is spawned after setting SIGCHLD to SIG_IGN. Arguably it may be a broken setting, but we should protect ourselves so that we can get reliable results from waitpid() for the children we care about. This patch resets SIGCHLD to SIG_DFL in three places: - connect.c::git_connect() - initiators of git native protocol transfer are covered with this. - daemon.c::main() - obviously. - merge-index.c::main() - obviously. There are other programs that do fork() but do not waitpid(): http-push, imap-send. upload-pack does not either, but in the case of that program, each of the forked halves runs exec() another program, so this change would not have much effect there. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19xdiff: minor changes to match libxdiff-0.21Libravatar Junio C Hamano2-7/+5
This reformats the change 621c53cc082299eaf69e9f2dc0274547c7d87fb0 introduced to match what upstream author implemented in libxdiff-0.21 without changing any logic (hopefully ;-). This is to help keep us in sync with the upstream. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19fix rfc2047 formatter.Libravatar Junio C Hamano1-4/+17
Running git-format-patch on patches from Lukas destroyed the From: line. This fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Fix t8001-annotate and t8002-blame for ActiveState PerlLibravatar Dennis Stosberg1-1/+1
There seems to be at least one implementation of Perl which requires the user to specify an extension for backup files. Reported by Alex Riesen. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Add specialized object allocatorLibravatar Linus Torvalds7-5/+67
This creates a simple specialized object allocator for basic objects. This avoids wasting space with malloc overhead (metadata and extra alignment), since the specialized allocator knows the alignment, and that objects, once allocated, are never freed. It also allows us to track some basic statistics about object allocations. For example, for the mozilla import, it shows object usage as follows: blobs: 627629 (14710 kB) trees: 1119035 (34969 kB) commits: 196423 (8440 kB) tags: 1336 (46 kB) and the simpler allocator shaves off about 2.5% off the memory footprint off a "git-rev-list --all --objects", and is a bit faster too. [ Side note: this concludes the series of "save memory in object storage". The thing is, there simply isn't much more to be saved on the objects. Doing "git-rev-list --all --objects" on the mozilla archive has a final total RSS of 131498 pages for me: that's about 513MB. Of that, the object overhead is now just 56MB, the rest is going somewhere else (put another way: the fact that this patch shaves off 2.5% of the total memory overhead, considering that objects are now not much more than 10% of the total shows how big the wasted space really was: this makes object allocations much more memory- and time-efficient). I haven't looked at where the rest is, but I suspect the bulk of it is just the pack-file loading. It may be that we should pack the tree objects separately from the blob objects: for git-rev-list --objects, we don't actually ever need to even look at the blobs, but since trees and blobs are interspersed in the pack-file, we end up not being dense in the tree accesses, so we end up looking at more pages than we strictly need to. So with a 535MB pack-file, it's entirely possible - even likely - that most of the remaining RSS is just the mmap of the pack-file itself. We don't need to map in _all_ of it, but we do end up mapping a fair amount. ] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Read configuration also from $HOME/.gitconfigLibravatar Johannes Schindelin2-15/+58
This patch is based on Pasky's, with three notable differences: - I did not yet update the documentation - I named it .gitconfig, not .gitrc - git-repo-config does not barf when a unique key is overridden locally The last means that if you have something like [alias] l = log --stat -M in ~/.gitconfig, and [alias] l = log --stat -M next.. in $GIT_DIR/config, then git-repo-config alias.l returns only one value, namely the value from $GIT_DIR/config. If you set the environment variable GIT_CONFIG, $HOME/.gitconfig is not read, and neither $GIT_DIR/config, but $GIT_CONFIG instead. If you set GIT_CONFIG_LOCAL instead, it is interpreted instead of $GIT_DIR/config, but $HOME/.gitconfig is still read. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Fix setting config variables with an alternative GIT_CONFIGLibravatar Johannes Schindelin3-4/+37
When setting a config variable, git_config_set() ignored the variables GIT_CONFIG and GIT_CONFIG_LOCAL. Now, when GIT_CONFIG_LOCAL is set, it will write to that file. If not, GIT_CONFIG is checked, and only as a fallback, the change is written to $GIT_DIR/config. Add a test for it, and also future-proof the test for the upcoming $HOME/.gitconfig support. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Initialize lock_file struct to all zero.Libravatar Johannes Schindelin2-2/+2
hold_lock_file_for_update() relies on that. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19Make CSS file gitweb/gitweb.css more readableLibravatar Jakub Narebski1-50/+222
Taken from git://git.xmms.se/xmms2/gitweb-xmms2.git commit 561262030d58a6325f500b36d836dbe02a5abc68 "Make CSS readable" by Daniel Svensson, with extra parts removed and consistent whitespace usage. [jc: tabified the results to cleaning things up, and removed an added item that was commented out. ] Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Merge early parts of branch 'ff/c99'Libravatar Junio C Hamano8-38/+50
2006-06-18Merge early parts of branch 'ls/am'Libravatar Junio C Hamano9-127/+200
2006-06-18Make git-update-ref a builtinLibravatar Lukas Sandström4-5/+11
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Make git-update-index a builtinLibravatar Lukas Sandström4-11/+18
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Make git-stripspace a builtinLibravatar Lukas Sandström4-9/+19
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Make git-mailinfo a builtinLibravatar Lukas Sandström4-46/+61
[jc: with a bit of constness tightening] Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Make git-mailsplit a builtinLibravatar Lukas Sandström4-33/+48
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Make git-write-tree a builtinLibravatar Lukas Sandström4-30/+50
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Merge branch 'jn/web' into nextLibravatar Junio C Hamano2-63/+144
* jn/web: Fix gitweb stylesheet Support for the standard mime.types map in gitweb gitweb: text files for 'blob_plain' action without charset by default gitweb: safely output binary files for 'blob_plain' action Move gitweb style to gitweb.css
2006-06-18Merge branch 'pb/config' into nextLibravatar Junio C Hamano9-80/+175
* pb/config: Support for extracting configuration from different files Fix PPC SHA1 routine for large input buffers Make t8001-annotate and t8002-blame more portable Remove "refs" field from "struct object" Make release tarballs friendlier to older tar versions
2006-06-18Fix gitweb stylesheetLibravatar Jakub Narebski1-0/+4
An earlier commit forgot to move some piece from the CGI script to the external stylesheet. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Support for the standard mime.types map in gitwebLibravatar Petr Baudis1-0/+44
gitweb will try to look up the filename mimetype in /etc/mime.types and optionally a user-configured mime.types map as well. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18gitweb: text files for 'blob_plain' action without charset by defaultLibravatar Jakub Narebski1-3/+3
$default_text_plain_charset is undefined (no specified charset) by default. Additionally ':raw' layer for binmode is used for outputting file content. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18gitweb: safely output binary files for 'blob_plain' actionLibravatar Jakub Narebski1-4/+39
gitweb tries now to output correct Content-Type header for 'blob_plain' action; for now text/plain for text files, appropriate image MIME type for *.png, *.gif and *.jpg/*.jpeg files, and application/octet-stream for other binary files. Introduced new configuration variables: $default_blob_plain_mimetype and $default_text_plain_charset (only 'utf-8' is guaranteed to work for the latter). binmode changed to ':raw' in git_blob_plain for output of non-text files. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Move gitweb style to gitweb.cssLibravatar Jakub Narebski2-60/+58
Move gitweb style from embedded <style> element in gitweb/gitweb.cgi to external CSS file gitweb/gitweb.css. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Change types used in bitfields to be `int's.Libravatar Florian Forster1-1/+1
According to ANSI C99 bitfields are only defined for `signed int' and `unsigned int'. This patch corrects the bitfield in the `msg_data_t' type from `imap-send.c'. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Don't use empty structure initializers.Libravatar Florian Forster1-2/+1
Empty initializers for structures are not allowed in ANSI C99. This patch removes such an initializer from `builtin-read-tree.c'. Since the struct was static (and is therefore implicitely initialized to zero anyway) it wasn't actually needed. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Cast pointers to `void *' when used in a format.Libravatar Florian Forster1-2/+2
ANSI C99 requires void-pointers when using the `%p' format. This patch adds the neccessary cast in `blame.c'. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Don't instantiate structures with FAMs.Libravatar Florian Forster1-19/+22
Since structures with `flexible array members' are an incomplete datatype ANSI C99 forbids creating instances of them. This patch removes such an instance from `diff-lib.c' and replaces it with a pointer to a `struct combine_diff_path'. Since all neccessary memory is allocated at once the number of calls to `xmalloc' is not increased. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Initialize FAMs using `FLEX_ARRAY'.Libravatar Florian Forster1-1/+2
When initializing a `flexible array member' the macro `FLEX_ARRAY' should be used. This was forgotten in `diff-delta.c'. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Remove ranges from switch statements.Libravatar Florian Forster3-13/+22
Though very nice and readable, the "case 'a'...'z':" construct is not ANSI C99 compliant. This patch unfolds the range in `quote.c' and substitutes the switch-statement with an if-statement in `http-fetch.c' and `http-push.c'. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18Support for extracting configuration from different filesLibravatar Petr Baudis2-1/+23
Add $GIT_CONFIG environment variable whose content is used instead of .git/config if set. Also add $GIT_CONFIG_LOCAL as a forward-compatibility cue for whenever we will finally come to support] global configuration files (properly). Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>