summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove shadowing variable from traverse_trees()René Scharfe2007-01-041-1/+0
| | | | | | | | | | | | | The variable named entry is allocated using malloc() and then forgotten, it being shadowed by an automatic variable of the same name. Fixing the array size at 3 worked so far because the only caller of traverse_trees() needed only as much entries. Simply remove the shadowing varaible and we're able to traverse more than three trees and save stack space at the same time! Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make check target depend on common-cmds.hRené Scharfe2007-01-041-1/+1
| | | | | | | | This fixes sparse complaining about a missing include file if 'make check' is run on clean sources. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <junkio@cox.net>
* rerere: Fix removal of already resolved path.Junio C Hamano2007-01-041-4/+3
| | | | | | | There was an obvious thinko in memmove() to remove an entry that was resolved from the in-core data structure. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'maint'Junio C Hamano2007-01-044-7/+22
|\ | | | | | | | | | | * maint: pack-check.c::verify_packfile(): don't run SHA-1 update on huge data Fix infinite loop when deleting multiple packed refs.
| * pack-check.c::verify_packfile(): don't run SHA-1 update on huge datav1.4.4.4Junio C Hamano2007-01-041-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the SHA1_Update() on the whole packfile in a single call revealed an overflow problem we had in the SHA-1 implementation on POWER architecture some time ago, which was fixed with commit b47f509b (June 19, 2006). Other SHA-1 implementations may have a similar problem. The sliding mmap() series already makes chunked calls to SHA1_Update(), so this patch itself will become moot when it graduates to "master", but in the meantime, run the hash function in smaller chunks to prevent possible future problems. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Fix infinite loop when deleting multiple packed refs.Junio C Hamano2007-01-033-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was stupid to link the same element twice to lock_file_list and end up in a loop, so we certainly need a fix. But it is not like we are taking a lock on multiple files in this case. It is just that we leave the linked element on the list even after commit_lock_file() successfully removes the cruft. We cannot remove the list element in commit_lock_file(); if we are interrupted in the middle of list manipulation, the call to remove_lock_file_on_signal() will happen with a broken list structure pointed by lock_file_list, which would cause the cruft to remain, so not removing the list element is the right thing to do. Instead we should be reusing the element already on the list. There is already a code for that in lock_file() function in lockfile.c. The code checks lk->next and the element is linked only when it is not already on the list -- which is incorrect for the last element on the list (which has NULL in its next field), but if you read the check as "is this element already on the list?" it actually makes sense. We do not want to link it on the list again, nor we would want to set up signal/atexit over and over. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Fix shortlog only showing HEAD revision.Robert Fitzsimons2007-01-031-1/+1
| | | | | | | | | | | | | | | | | | My change in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6 had a small bug found by Michael Krufky which caused the passed in hash value to be ignored, so shortlog would only show the HEAD revision. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-verify-tag: make sure we remove temporary file.Junio C Hamano2007-01-031-0/+3
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | git-tag: add flag to verify a tagSanti Béjar2007-01-033-3/+16
| | | | | | | | | | | | | | This way "git tag -v $tag" is the UI for git-verify-tag. Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Refactor print-functions in builtin-branchLars Hjemli2007-01-031-43/+40
| | | | | | | | | | | | | | | | This moves the guts of print_ref_list() into a revamped print_ref_info(), which at the same time gets renamed to print_ref_item(). Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: There can be empty patches (in git_patchset_body)Jakub Narebski2007-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | We now do not skip over empty patches in git_patchset_body (where empty means that they consist only of git diff header, and of extended diff header), so uncomment branch of code dealing with empty patches (patches which do not have even two-line from/to header) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')Jakub Narebski2007-01-031-1/+1
| | | | | | | | | | | | | | | | Fix bug in git_difftree_body subroutine; it was used '!=' comparison operator for strings (file type) instead of correct 'ne'. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Documentation/tutorial: misc updatesSanti Béjar2007-01-031-4/+13
| | | | | | | | | | | | | | | | | | - Teach how to delete a branch with "git branch -d name". - Usually a commit has one parent; merge has more. - Teach "git show" instead of "git cat-file -p". Signed-off-by: Santi Béjar <sbejar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | tutorial: misc updates.Junio C Hamano2007-01-031-7/+17
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Skip excessive blank lines before commit bodyLars Hjemli2007-01-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | This modifies pretty_print_commit() to make the output of git-rev-list and friends a bit more predictable. A commit body starting with blank lines might be unheard-of, but still possible to create using git-commit-tree (so is bound to appear somewhere, sometime). Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Add documentation for git-branch's color configuration.Brian Gernhardt2007-01-033-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | Added color.branch and color.branch.<slot> to configuration list. Style copied from color.status and meanings derived from the code. Moved the color meanings from color.diff.<slot> to color.branch.<slot> since the latter comes first alphabetically. Added --color and --no-color to git-branch's usage and documentation. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Fix error in git_project_index subroutineJakub Narebski2007-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | Instead of "$projectroot/$pr->{'path'}" to get the path to project GIT_DIR, it was used "$projectroot/$project" which is valid only for actions where project parameter is set, and 'project_index' is not one of them. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | send pack check for failure to send revisions listAndy Whitcroft2007-01-023-2/+30
| | | | | | | | | | | | | | | | | | | | | | When passing the revisions list to pack-objects we do not check for errors nor short writes. Introduce a new write_in_full which will handle short writes and report errors to the caller. Use this to short cut the send on failure, allowing us to wait for and report the child in case the failure is its fault. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | instaweb: load Apache mime and dir modules if they are neededEric Wong2007-01-021-0/+10
| | | | | | | | | | | | | | | | | | | | I've noticed that Apache 2.2 on a Debian etch machine has these compiled as modules. Also set ServerName to avoid a warning at startup. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | fetch-pack: do not use lockfile structure on stack.Junio C Hamano2007-01-021-1/+2
| | | | | | | | | | | | | | | | | | They are used in atexit() for clean-up, and you will be accessing unallocated memory at that point. See 31f584c2 for the fix for a similar problem. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Remove unused variable (git-commit.sh)Junio C Hamano2007-01-011-1/+0
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Update clone/fetch documentation with --depth (shallow clone) optionJunio C Hamano2007-01-012-1/+16
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Strongly discourage --update-head-ok in fetch-options documentation.Junio C Hamano2007-01-011-2/+4
| | | | | | | | | | | | | | "Use it with care" is a wrong wording to say "this is purely internal and you are supposed to know what you are doing if you use this". Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'sp/merge' (early part)Junio C Hamano2007-01-012-14/+20
|\ \ | | | | | | | | | | | | | | | | | | * 'sp/merge' (early part): Use merge-recursive in git-am -3. Allow merging bare trees in merge-recursive. Move better_branch_name above get_ref in merge-recursive.
| * | Use merge-recursive in git-am -3.Shawn O. Pearce2006-12-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By switching from merge-resolve to merge-recursive in the 3-way fallback behavior of git-am we gain a few benefits: * renames are automatically handled, like in rebase -m; * conflict hunks can reference the patch name; * its faster on Cygwin (less forks). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Allow merging bare trees in merge-recursive.Shawn O. Pearce2006-12-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support wider use cases, such as from within `git am -3`, the merge-recursive utility needs to accept not just commit-ish but also tree-ish as arguments on its command line. If given a tree-ish then merge-recursive will create a virtual commit wrapping it, with the subject of the commit set to the best name we can derive for that tree, which is either the command line string (probably the SHA1), or whatever string appears in GITHEAD_*. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Move better_branch_name above get_ref in merge-recursive.Shawn O. Pearce2006-12-281-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | To permit the get_ref function to use the static better_branch_name function to generate a string on demand I'm moving it up earlier. The actual logic was not affected in this change. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Documentation: remove master:origin example from pull-fetch-param.txtJ. Bruce Fields2007-01-011-4/+0
| | | | | | | | | | | | | | | | | | | | | This is no longer a useful example. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Documentation: update git-pull.txt for new clone behaviorJ. Bruce Fields2007-01-011-44/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update examples, stop using branch named "origin" as an example. Remove large example of use of remotes; that particular case is nicely automated by default, so it's not so pressing to explain, and we can refer to git-repo-config for the details. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-fetch: remove .keep file at the end.Junio C Hamano2007-01-011-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | Removal of them is needed regardless of errors. The original code had the removal outside of the process which sets the flag to tell the later step what to remove, but it runs as a downstream of a pipeline and its effect was lost. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | fail pull/merge early in the middle of conflicted mergeJunio C Hamano2007-01-012-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After a pull that results in a conflicted merge, a new user often tries another "git pull" in desperation. When the index is unmerged, merge backends correctly bail out without touching either index nor the working tree, so this does not make the wound any worse. The user will however see several lines of messsages during this process, such as "filename: needs merge", "you need to resolve your current index first", "Merging...", and "Entry ... would be overwritten by merge. Cannot merge.". They are unnecessarily alarming, and cause useful conflict messages from the first pull scroll off the top of the terminal. This changes pull and merge to run "git-ls-files -u" upfront and stop them much earlier than we currently do. Old timers may know better and would not to try pulling again before cleaning things up; this change adds extra overhead that is unnecessary for them. But this would be worth paying for to save new people from needless confusion. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Update send-pack pipeline documentation.Junio C Hamano2007-01-011-65/+16
| | | | | | | | | | | | | | | | | | | | | The pipeline was much more complex and needed documentation, but now it is trivial and straightforward. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-svn: t/t91??-*: optimize the tests a bitEric Wong2006-12-313-19/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes some unnecessary 'svn up' calls throughout t9103-git-svn-graft-branches.sh: * removed an 'svn log' call that was leftover from debugging * removed multiple git-svn calls with a multi-init / multi-fetch combination (which weren't tested before, either) * replaced `rev-list ... | head -n1` with `rev-parse ...` (not sure what I was thinking when I wrote that) All this saves about 9 seconds from a test run (53s -> 44s for 'make t91*') on my 1.3GHz Athlon Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINKEric Wong2006-12-311-49/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | We don't support the svn command-line client anymore; nor do we support anything before SVN 1.1.0, so we can be certain symlinks will be supported in the SVN repository. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-svn: remove svnadmin dependency from the testsEric Wong2006-12-311-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | We require the libraries now, so we can create repositories using them (and save some executable load time while we're at it). Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | i18n: do not leak 'encoding' header even when we cheat the conversion.Junio C Hamano2006-12-311-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | We special case the case where encoding recorded in the commit and the output encoding are the same and do not call iconv(). But we should drop 'encoding' header for this case as well for consistency. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Do not merge random set of refs out of wildcarded refsJunio C Hamano2006-12-311-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When your fetch configuration has only the wildcards, we would pick the lexicographically first ref from the remote side for merging, which was complete nonsense. Make sure nothing except the one that is specified with branch.*.merge is merged in this case. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Fix formatting for urls section of fetch, pull, and push manpagesTheodore Tso2006-12-311-12/+14
| | | | | | | | | | | | | | | | | | | | | Updated to make the nroff'ed man pages look nicer. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Documentation: update tutorial's discussion of originJ. Bruce Fields2006-12-311-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | Update tutorial's discussion of origin branch to reflect new defaults, and include a brief mention of git-repo-config. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Documentation: update glossary entry for "origin"J. Bruce Fields2006-12-311-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update glossary entry for "origin" to reflect fact that it normally now refers to a remote repository, not a branch. Also, warning not to work on remote-tracking branches is no longer necessary since git doesn't allow that. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Documentation: update git-clone.txt for clone's new default behaviorJ. Bruce Fields2006-12-311-7/+4
| | | | | | | | | | | | | | | | | | | | | Fix a couple remaining references to the origin branch. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Docs: update cvs-migration.txt to reflect clone's new default behaviorJ. Bruce Fields2006-12-311-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I couldn't think of a really quick way to give all the details, so just refer readers to the git-repo-config man page instead. I haven't tested recent cvs import behavior--some time presumably it should be updated to do something more similar to clone. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | send-pack: tell pack-objects to use its internal rev-list.Junio C Hamano2006-12-311-97/+42
| | | | | | | | | | | | | | | | | | | | | This means one less process in the pipeline to worry about, and removes about 1/8 of the code. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | send-pack.c: use is_null_sha1()Junio C Hamano2006-12-311-12/+1
| | | | | | | | | | | | | | | | | | | | | Everybody else uses is_null_sha1() -- there is no point to have its own is_zero_sha1() anymore. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Update documentation for update hook.Junio C Hamano2006-12-311-2/+2
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/send-pack-pipeline'Junio C Hamano2006-12-312-5/+114
|\ \ \ | | | | | | | | | | | | | | | | | | | | * jc/send-pack-pipeline: Documentation: illustrate send-pack pipeline. send-pack: fix pipeline.
| * | | Documentation: illustrate send-pack pipeline.Junio C Hamano2006-12-291-0/+112
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | send-pack: fix pipeline.Junio C Hamano2006-12-291-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | send-pack builds a pipeline that runs "rev-list | pack-objects" and sends the output from pack-objects to the other side, while feeding the input side of that pipe from itself. However, the file descriptor that is given to this pipeline (so that it can be dup2(2)'ed into file descriptor 1 of pack-objects) is closed by the caller before the complex fork+exec dance! Worse yet, the caller already dup2's it to 1, so the child process did not even have to. I do not understand how this code could possibly have been working, but it somehow was working by accident. Merging the sliding mmap() code reveals this problem, presumably because it keeps one extra file descriptor open for a packfile and changes the way file descriptors are allocated. I am too tired to diagnose the problem now, but this seems to be a sensible fix. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Add test case for update hooks in receive-pack.Shawn O. Pearce2006-12-311-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that the update hooks work as documented/advertised. This is a simple set of tests to check that the update hooks run with the parameters expected, have their STDOUT and STDERR redirected to the client side of the connection, and that their STDIN does not contain any data (as its actually /dev/null). Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Documentation/config.txt (and repo-config manpage): mark-up fix.Junio C Hamano2006-12-301-7/+7
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>