aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* convert object type handling from a string to a numberNicolas Pitre2007-02-27
| | | | | | | | | | | | | | | We currently have two parallel notation for dealing with object types in the code: a string and a numerical value. One of them is obviously redundent, and the most used one requires more stack space and a bunch of strcmp() all over the place. This is an initial step for the removal of the version using a char array found in object reading code paths. The patch is unfortunately large but there is no sane way to split it in smaller parts without breaking the system. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* formalize typename(), and add its reverse type_from_string()Nicolas Pitre2007-02-27
| | | | | | | | | | | | Sometime typename() is used, sometimes type_names[] is accessed directly. Let's enforce typename() all the time which allows for validating the type. Also let's add a function to go from a name to a type and use it instead of manual memcpy() when appropriate. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* sha1_file.c: don't ignore an error condition in sha1_loose_object_info()Nicolas Pitre2007-02-27
| | | | | Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* sha1_file.c: cleanup "offset" usageNicolas Pitre2007-02-27
| | | | | | | | | | | | | | | First there are too many offsets there and it is getting confusing. So 'offset' is now 'curpos' to distinguish from other offsets like 'obj_offset'. Then structures like x = foo(x, &y) are now done as y = foo(&x). It looks more natural that the result y be returned directly and x be passed as reference to be updated in place. This has the effect of reducing some line length and removing a few, needing a bit less stack space, and it even reduces the compiled code size. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* sha1_file.c: cleanup hdr usageNicolas Pitre2007-02-27
| | | | | | | | | | | | | Let's have hdr be a simple char pointer/array when possible, and let's reduce its storage to 32 bytes. Especially for sha1_loose_object_info() where 128 bytes is way excessive and wastes extra CPU cycles inflating. The object type is already restricted to 10 bytes in parse_sha1_header() and the size, even if it is 64 bits, will fit in 20 decimal numbers. So 32 bytes is plenty. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'maint'Junio C Hamano2007-02-27
|\ | | | | | | | | | | | | * maint: git-apply: do not fix whitespaces on context lines. diff --cc: integer overflow given a 2GB-or-larger file mailinfo: do not get confused with logical lines that are too long.
| * git-apply: do not fix whitespaces on context lines.Junio C Hamano2007-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internal function apply_line() is called to copy both context lines and added lines to the output buffer, while possibly fixing the whitespace breakages depending on --whitespace=strip settings. However, it did its fix-up on both context lines and added lines. This resulted in two symptoms: (1) The number of lines reported to have been fixed up included these context lines. (2) However, the lines actually shown were limited to the added lines that had whitespace breakages. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff --cc: integer overflow given a 2GB-or-larger fileJim Meyering2007-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Few of us use git to compare or even version-control 2GB files, but when we do, we'll want it to work. Reading a recent patch, I noticed two lines like this: int len = st.st_size; Instead of "int", that should be "size_t". Otherwise, in the non-symlink case, with 64-bit size_t, if the file's size is 2GB, the following xmalloc will fail: result = xmalloc(len + 1); trying to allocate 2^64 - 2^31 + 1 bytes (assuming sign-extension in the int-to-size_t promotion). And even if it didn't fail, the subsequent "result[len] = 0;" would be equivalent to an unpleasant "result[-2147483648] = 0;" The other nearby "int"-declared size variable, sz, should also be of type size_t, for the same reason. If sz ever wraps around and becomes negative, xread will corrupt memory _before_ the "result" buffer. Signed-off-by: Jim Meyering <jim@meyering.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * mailinfo: do not get confused with logical lines that are too long.Linus Torvalds2007-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | It basically considers all the continuation lines to be lines of their own, and if the total line is bigger than what we can fit in it, we just truncate the result rather than stop in the middle and then get confused when we try to parse the "next" line (which is just the remainder of the first line). [jc: added test, and tightened boundary a bit per list discussion.] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Documentation: link in 1.5.0.2 material to the top documentation page.Junio C Hamano2007-02-26
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Documentation: document remote.<name>.tagoptAneesh Kumar K.V2007-02-26
| | | | | | | | | | | | | | Update config.txt with info regarding tagopt option Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'maint'Junio C Hamano2007-02-26
|\ \ | |/ | | | | | | | | | | | | * maint: GIT 1.5.0.2 git-remote: support remotes with a dot in the name Documentation: describe "-f/-t/-m" options to "git-remote add" diff --cc: fix display of symlink conflicts during a merge.
| * GIT 1.5.0.2v1.5.0.2Junio C Hamano2007-02-26
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * git-remote: support remotes with a dot in the namePavel Roskin2007-02-26
| | | | | | | | | | | | | | | | | | | | [jc: the original from Pavel was limiting the variable names to only fetch and url, but I loosened it to take valid variable names.] [jc: cherry-picked from 'master', since people seem to be reinventing this many times.] Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Documentation: describe "-f/-t/-m" options to "git-remote add"Junio C Hamano2007-02-25
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff --cc: fix display of symlink conflicts during a merge.Junio C Hamano2007-02-25
| | | | | | | | | | | | | | | | "git-diff-files --cc" to show conflicts during merge did not pass the correct mode information for the working tree down, and showed bogus combined diff. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'maint'Junio C Hamano2007-02-25
|\ \ | |/ | | | | | | | | * maint: merge-recursive: fix longstanding bug in merging symlinks merge-index: fix longstanding bug in merging symlinks
| * Merge branch 'jc/merge-symlink' into maintJunio C Hamano2007-02-25
| |\ | | | | | | | | | | | | | | | * jc/merge-symlink: merge-recursive: fix longstanding bug in merging symlinks merge-index: fix longstanding bug in merging symlinks
| | * merge-recursive: fix longstanding bug in merging symlinksJunio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3af244ca added unlink(2) before running symlink(2) to update the working tree with the merge result, but it was unlinking a wrong path. This resulted in loss of the path pointed by a symlink. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * merge-index: fix longstanding bug in merging symlinksJunio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ancient commit e2b6a9d0 added code to pass "file modes" from merge-index to merge-one-file, and then later commit 54dd99a1 wanted to make sure we do not end up creating a nonsense symlink that points at a path whose name contains conflict markers. However, nobody noticed that the code in merge-index added by e2b6a9d0 were stripping the S_IFMT bits and the code in 54dd99a1 was meaningless. This fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | diff --cached: give more sensible error message when HEAD is yet to be created.Junio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | It is not like the user said 'diff --cached HEAD', so complaining about HEAD not being a valid commit, while technically might be correct, is not very helpful. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Update tests to use test-chmtimeEric Wong2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test-lib: Make sure test-chmtime has been built before starting. t4200-rerere: Removed non-portable date dependency and avoid touch Avoid "test -a" which isn't portable, either lib-git-svn: Use test-chmtime instead of Perl one-liner to poke Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Add test-chmtime: a utility to change mtime on filesEric Wong2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended to be a portable replacement for our usage of date(1), touch(1), and Perl one-liners in tests. Usage: test-chtime (+|=|-|=+|=-)<seconds> <file>..." '+' increments the mtime on the files by <seconds> '-' decrements the mtime on the files by <seconds> '=' sets the mtime on the file to exactly <seconds> '=+' and '=-' sets the mtime on the file to <seconds> after or before the current time. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'maint'Junio C Hamano2007-02-25
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * maint: Add Release Notes to prepare for 1.5.0.2 Allow arbitrary number of arguments to git-pack-objects rerere: do not deal with symlinks. rerere: do not skip two conflicted paths next to each other. Don't modify CREDITS-FILE if it hasn't changed.
| * | Add Release Notes to prepare for 1.5.0.2Junio C Hamano2007-02-25
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Allow arbitrary number of arguments to git-pack-objectsRoland Dreier2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a repository ever gets in a situation where there are too many packs (more than 60 or so), perhaps because of frequent use of git-fetch -k or incremental git-repack, then it becomes impossible to fully repack the repository with git-repack -a. That command just dies with the cryptic message fatal: too many internal rev-list options This message comes from git-pack-objects, which is passed one command line option like --unpacked=pack-<SHA1>.pack for each pack file to be repacked. However, the current code has a static limit of 64 command line arguments and just aborts if more arguments are passed to it. Fix this by dynamically allocating the array of command line arguments, and doubling the size each time it overflows. Signed-off-by: Roland Dreier <roland@digitalvampire.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | rerere: do not deal with symlinks.Junio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | Who would use multi-line symlinks that would benefit from rerere? Just ignore them. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | rerere: do not skip two conflicted paths next to each other.Junio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | The code forgot to take the for (;;) loop control into account, incrementing the index once too many. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Merge git://repo.or.cz/git-gui into maintJunio C Hamano2007-02-24
| |\ \ | | | | | | | | | | | | | | | | * git://repo.or.cz/git-gui: Don't modify CREDITS-FILE if it hasn't changed.
| | * | Don't modify CREDITS-FILE if it hasn't changed.Junio C Hamano2007-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should always avoid rewriting a built file during `make install` if nothing has changed since `make all`. This is to help support the typical installation process of compiling a package as yourself, then installing it as root. Forcing CREDITS-FILE to be always be rebuilt in the Makefile means that CREDITS-GEN needs to check for a change and only update CREDITS-FILE if the file content actually differs. After all, content is king in Git. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | Merge branch 'js/apply'Junio C Hamano2007-02-24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * js/apply: apply: make --verbose a little more useful
| * | | | apply: make --verbose a little more usefulJohannes Schindelin2007-02-22
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a patch fails, I automatically add '-v' to the command line to see what fails. This patch makes -v a synonym to --verbose, and actually tells the user which text was not found. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'js/no-limit-boundary'Junio C Hamano2007-02-24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * js/no-limit-boundary: rev-list --max-age, --max-count: support --boundary
| * | | | rev-list --max-age, --max-count: support --boundaryJohannes Schindelin2007-02-19
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, when saying --max-age=<timestamp>, or --max-count=<n>, together with --boundary, rev-list prints the boundary commits, i.e. the commits which are _just_ not shown without --boundary, i.e. their children are, but they aren't. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'js/etc-config'Junio C Hamano2007-02-24
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * js/etc-config: Make tests independent of global config files config: read system-wide defaults from /etc/gitconfig
| * | | | Make tests independent of global config filesJohannes Schindelin2007-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was done by setting $HOME to somewhere bogus. A better method is to reuse $GIT_CONFIG, which was invented for ignoring the global config file explicitely. Technically, setting GIT_CONFIG=.git/config could be wrong, but it passes all the tests, and we can keep the tests that way. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | config: read system-wide defaults from /etc/gitconfigJohannes Schindelin2007-02-19
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The settings in /etc/gitconfig can be overridden in ~/.gitconfig, which in turn can be overridden in .git/config. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'maint'Junio C Hamano2007-02-24
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: diff-patch: Avoid emitting double-slashes in textual patch. Reword git-am 3-way fallback failure message. Limit filename for format-patch core.legacyheaders: Use the description used in RelNotes-1.5.0 git-show-ref --verify: Fail if called without a reference Conflicts: builtin-show-ref.c diff.c
| * | | diff-patch: Avoid emitting double-slashes in textual patch.Junio C Hamano2007-02-24
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Reword git-am 3-way fallback failure message.Junio C Hamano2007-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the blobs recorded on the index lines in the patch as pre-image blobs are not found in the repository, "git-am" punted saying that the index line does not record anything useful. This was not clear enough -- the index line does have something useful but the problem was that it was not useful in _that_ repository. Reword the message as Francis Moreau suggests. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | Limit filename for format-patchRobin Rosenberg2007-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Badly formatted commits may have very long comments. This causes git-format-patch to fail. To avoid that, truncate the filename to a value we believe will always work. Err out if the patch file cannot be created. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | core.legacyheaders: Use the description used in RelNotes-1.5.0Santi Béjar2007-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It explains what it does and why, and says how to use the new format. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | git-show-ref --verify: Fail if called without a referenceDmitry V. Levin2007-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but without a reference. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | .mailmap maintenance after pulling from git-svnJunio C Hamano2007-02-23
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | git-svn: fix some potential bugs with --follow-parentEric Wong2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using do_switch: We only need to ensure the index is clean and set to that of the parent tree) we rely on being able to reconstruct full files with deltas transferred over the network. When using do_update: We may safely unlink the index if we are fetching an entire new tree with do_update. Having an old index (from a previously deleted/abandoned directory) around can cause irrelevant files to be mistakenly kept. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | git-svn: fix reconnections to different paths of svn:// repositoriesEric Wong2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clearing the pool of the previous SVN::Ra connection we have seems to to fix mysterious connection dropping errors when reconnecting to different paths of svn:// repositories hosted by rubyforge.org. Note: I'm not sure *why* this fixes things things, but it does for me. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | git-svn: fix clone when a target directory has been specifiedEric Wong2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several bugs caused this to fail: * GIT_DIR was set incorrectly after entering the target directory * Avoid double chdir-ing when clone is called with an explicit path * create target subdirectory *before* running git-init when using the multi-init path Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | git-svn: document --usernameSam Vilain2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, it turns out that SVN::Ra doesn't attempt to deal with authentication or pass the username to ssh when doing svn+ssh:// URLs Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | git-svn: don't consider SVN URL usernames significant when comparingSam Vilain2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://foo@blah.com/path is the same as http://blah.com/path, so remove usernames from URLs before storing them in commits, and when reading them from commits. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | git-svn: ensure we're at the top-level and can access $GIT_DIREric Wong2007-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are run inside a subdirectory of a working tree, we'll chdir to the top first before touching anything. This also prevents the accidental creation of .git directories inside subdirectories since they need metadata. Noticed by maio on #git Signed-off-by: Eric Wong <normalperson@yhbt.net>