aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avoid 31-bit truncation in write_loose_objectJeff King2009-01-28
| | | | | | | | | | | | | The size of the content we are adding may be larger than 2.1G (i.e., "git add gigantic-file"). Most of the code-path to do so uses size_t or unsigned long to record the size, but write_loose_object uses a signed int. On platforms where "int" is 32-bits (which includes x86_64 Linux platforms), we end up passing malloc a negative size. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* test-path-utils: Fix off by one, found by valgrindJohannes Schindelin2009-01-27
| | | | | | | | | | When normalizing an absolute path, we might have to add a slash _and_ a NUL to the buffer, so the buffer was one too small. Let's just future proof the code and alloc PATH_MAX + 1 bytes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* get_sha1_basic(): fix invalid memory access, found by valgrindJohannes Schindelin2009-01-27
| | | | | | | | When get_sha1_basic() is passed a buffer of len 0, it should not check if buf[len-1] is a curly bracket. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix Documentation for git-describeBoyd Stephen Smith Jr2009-01-23
| | | | | | | | | The documentation for git-describe says the default abbreviation is 8 hexadecimal digits while cache.c clearly shows DEFAULT_ABBREV set to 7. This patch corrects the documentation. Signed-off-by: Boyd Stephen Smith Jr <bss@iguanasuicide.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-fsck: fix off by one head countChristian Couder2009-01-17
| | | | | | | | | | | | | According to the man page, if "git fsck" is passed one or more heads, it should verify connectivity and validity of only objects reachable from the heads it is passed. However, since 5ac0a20 (Make builtin-fsck.c use parse_options., 2007-10-15) the command behaved as if no heads were passed, when given only one argument. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: let asciidoc align related optionsMarkus Heidelberg2009-01-17
| | | | | | | | | Command line options can share the same paragraph of description, if they are related or synonymous. In these cases they should be written among each other, so that asciidoc can format them itself. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* githooks.txt: add missing wordStephan Beyer2009-01-17
| | | | | Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* builtin-commit.c: do not remove COMMIT_EDITMSGStephan Beyer2009-01-17
| | | | | | | | | | | | | | | | git-commit tries to remove the file ./COMMIT_EDITMSG instead of $GIT_DIR/COMMIT_EDITMSG after commit preparation (e.g. running hooks, launching editor). This behavior exists since f5bbc3225c4b07 "Port git commit to C". Some test cases (e.g. t/t7502-commit.sh) rely on the existence of $GIT_DIR/COMMIT_EDITMSG after committing and, I guess, many people are used to it. So it is best not to remove it. This patch just removes the removal of COMMIT_EDITMSG. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t3404: Add test case for auto-amending only edited commits after "edit"Stephan Beyer2009-01-15
| | | | | | | | Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t3404: Add test case for aborted --continue after "edit"Stephan Beyer2009-01-15
| | | | | | | | Add a test case for the bugfix introduced by commit 8beb1f33d "git-rebase-interactive: do not squash commits on abort". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t3501: check that commits are actually doneStephan Beyer2009-01-15
| | | | | | | | | | | The basic idea of t3501 is to check whether revert and cherry-pick works on renamed files. But as there is no pure cherry-pick/revert test, it is good to also check if commits are actually done in that scenario. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix handling of multiple untracked files for git mv -kMichael J Gruber2009-01-14
| | | | | | | | | | The "-k" option to "git mv" should allow specifying multiple untracked files. Currently, multiple untracked files raise an assertion if they appear consecutively as arguments. Fix this by decrementing the loop index after removing one entry from the array of arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add test cases for "git mv -k"Michael J Gruber2009-01-14
| | | | | | | | | Add test cases for ignoring nonexisting and untracked files using the -k option to "git mv". There is one known breakage related to multiple untracked files specfied as consecutive arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fast-import: Cleanup mode setting.Felipe Contreras2009-01-13
| | | | | | | | | | | | "S_IFREG | mode" makes only sense for 0644 and 0755. Even though doing (S_IFREG | mode) may not hurt when mode is any other supported value, that is only true because S_IFREG mode bit happens to be already on for S_IFLNK or S_IFGITLINK. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git.pm: call Error::Simple() properlyJay Soffian2009-01-13
| | | | | | | The error message to Error::Simple() must be passed as a single argument. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Avoid spurious error messages on error mistakes.Pierre Habouzit2009-01-13
| | | | | | | | | | | | | Prior to that, if the user chose "squash" as a first action, the stderr looked like: grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory Cannot 'squash' without a previous commit Now the first line is gone. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* contrib/examples/README: give an explanation of the status of these filesjidanni@jidanni.org2009-01-12
| | | | | | | | We attempt to give an explanation of the status of the files in this directory. Signed-off-by: jidanni <jidanni@jidanni.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint-1.5.6' into maint-1.6.0Junio C Hamano2009-01-06
|\ | | | | | | | | * maint-1.5.6: README: tutorial.txt is now called gittutorial.txt
| * README: tutorial.txt is now called gittutorial.txtJoey Hess2009-01-06
| | | | | | | | | | Signed-off-by: Joey Hess <joey@gnu.kitenet.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | doc/git-fsck: change the way for getting heads' SHA1sMarkus Heidelberg2008-12-21
| | | | | | | | | | | | | | | | | | The straightforward way with using 'cat .git/refs/heads/*' doesn't work with packed refs as well as branches of the form topic/topic1. So let's use git-for-each-ref for getting the heads' SHA1s in this example. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | GIT 1.6.0.6v1.6.0.6Junio C Hamano2008-12-19
|\ \ | |/ | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * GIT 1.5.6.6v1.5.6.6Junio C Hamano2008-12-16
| |\ | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * GIT 1.5.5.6v1.5.5.6Junio C Hamano2008-12-16
| | |\ | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | * GIT 1.5.4.7v1.5.4.7Junio C Hamano2008-12-16
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | * gitweb: do not run "git diff" that is PorcelainJunio C Hamano2008-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Jakub says that legacy-style URI to view two blob differences are never generated since 1.4.3. This codepath runs "git diff" Porcelain from the gitweb, which is a no-no. It can trigger diff.external command that is specified in the configuration file of the repository being viewed. This patch applies to v1.5.4 and later. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | fast-import: make tagger information optionalJunio C Hamano2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though newer Porcelain tools always record the tagger information when creating new tags, export/import pair should be able to faithfully reproduce ancient tag objects that lack tagger information. Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Shawn O. Pearce <spearce@spearce.org>
* | | | fast-export: deal with tag objects that do not have a taggerJohannes Schindelin2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no tagger was found (old Git produced tags like this), no "tagger" line is printed (but this is incompatible with the current git fast-import). Alternatively, you can pass the option --fake-missing-tagger, forcing fast-export to fake a tagger Unspecified Tagger <no-tagger> with a tag date of the beginning of (Unix) time in the case of a missing tagger, so that fast-import is still able to import the result. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | SubmittingPatches: mention the usage of real name in Signed-off-by: linesMiklos Vajna2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Especially with something that is supposed to hopefully have some legal value down the line if somebody starts making noises, it really would be nice to have a real person to associate things with. Suggest this in the SubmittingPatches document. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-mergetool: properly handle "git mergetool -- filename"David Aguilar2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like many git commands, git-mergetool allows "--" to signal the end of option processing. This adds a missing "shift" statement so that this is correctly handled. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-send-email: handle email address with quoted commaWu Fengguang2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correctly handle email addresses containing quoted commas, e.g. "Zhu, Yi" <yi.zhu@intel.com>, "Li, Shaohua" <shaohua.li@intel.com> The commas inside the double quotes are not separators. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Documentation: fix typos, grammar, asciidoc syntaxMarkus Heidelberg2008-12-19
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | fast-import: close pack before unlinking itJohannes Schindelin2008-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is sort of a companion patch to 4723ee9(Close files opened by lock_file() before unlinking.): on Windows, you cannot delete what is still open. This makes test 9300-fast-import pass on Windows for me; quite a few fast-imports leave temporary packs until the test "blank lines not necessary after other commands" actually tests for the number of files in .git/objects/pack/, which has a few temporary packs now. I guess that 8b4eb6b(Do not perform cross-directory renames when creating packs) was "responsible" for the breakage. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | pager: do not dup2 stderr if it is already redirectedJunio C Hamano2008-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier commit 61b8050 (sending errors to stdout under $PAGER, 2008-02-16) avoided losing the error messages that are sent to the standard error when $PAGER is in effect by dup2'ing fd 2 to the pager. his way, showing a tag object that points to a bad object: $ git show tag-foo would give the error message to the pager. However, it was not quite right if the user did: $ git show 2>error.log tag-foo i.e. use the pager but store the errors in a separate file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-show: do not segfault when showing a bad tagJunio C Hamano2008-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a tag points at a bad or nonexistent object, we should diagnose the breakage and exit. An earlier commit 4f3dcc2 (Fix 'git show' on signed tag of signed tag of commit, 2008-07-01) lost this check and made it segfault instead; not good. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-config.txt: fix a typoJim Meyering2008-12-12
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | fsck: reduce stack footprintLinus Torvalds2008-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logic to mark all objects that are reachable from tips of refs were implemented as a set of recursive functions. In a repository with a deep enough history, this can easily eat up all the available stack space. Restructure the code to require less stackspace by using an object array to keep track of the objects that still need to be processed. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | make sure packs to be replaced are closed beforehandNicolas Pitre2008-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Especially on Windows where an opened file cannot be replaced, make sure pack-objects always close packs it is about to replace. Even on non Windows systems, this could save potential bad results if ever objects were to be read from the new pack file using offset from the old index. This should fix t5303 on Windows. Signed-off-by: Nicolas Pitre <nico@cam.org> Tested-by: Johannes Sixt <j6t@kdbg.org> (MinGW) Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | work around Python warnings from AsciiDocJunio C Hamano2008-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears that a reference to an anchor defined as [[anchor-name]] from another place using <<anchor-name>> syntax, when the anchor name contains a string "-with-" in its name, triggers these warnings from Python interpreter. asciidoc -b docbook -d book user-manual.txt <string>:1: Warning: 'with' will become a reserved keyword in Python 2.6 <string>:1: Warning: 'with' will become a reserved keyword in Python 2.6 <string>:1: Warning: 'with' will become a reserved keyword in Python 2.6 <string>:1: Warning: 'with' will become a reserved keyword in Python 2.6 There currently is no reference to "Finding comments with given content", but for consistency and for futureproofing, the anchor is also updated as the other ones that are actually used and trigger these warnings. Signed-off-by: Junio C Hamano <junio@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | git-svn: Make following parents atomicDeskin Miller2008-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_parent_branch generates branch@rev type branches when one has to look back through SVN history to properly get the history for a branch copied from somewhere not already being tracked by git-svn. If in the process of fetching this history, git-svn is interrupted, then when one fetches again, it will use whatever was last fetched as the parent commit and fail to fetch any more history which it didn't get to before being terminated. This is especially troubling in that different git-svn copies of the same SVN repository can end up with different commit sha1s, incorrectly showing the history as divergent and precluding easy collaboration using git push and fetch. To fix this, when we initialise the Git::SVN object $gs to search for and perhaps fetch history, we check if there are any commits in SVN in the range between the current revision $gs is at, and the top revision for which we were asked to fill history. If there are commits we're missing in that range, we continue the fetch from the current revision to the top, properly getting all history before using it as the parent for the branch we're trying to create. Signed-off-by: Deskin Miller <deskinm@umich.edu> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | GIT 1.6.0.5v1.6.0.5Junio C Hamano2008-12-07
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | "git diff <tree>{3,}": do not reverse order of argumentsMatt McCutchen2008-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the message of commit 0fe7c1de16f71312e6adac4b85bddf0d62a47168, "git diff" with three or more trees expects the merged tree first followed by the parents, in order. However, this command reversed the order of its arguments, resulting in confusing diffs. A comment /* Again, the revs are all reverse */ suggested there was a reason for this, but I can't figure out the reason, so I removed the reversal of the arguments. Test case included. Signed-off-by: Matt McCutchen <matt@mattmccutchen.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | | tag: delete TAG_EDITMSG only on successful tagJeff King2008-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user may put some effort into writing an annotated tag message. When the tagging process later fails (which can happen fairly easily, since it may be dependent on gpg being correctly configured and used), there is no record left on disk of the tag message. Instead, let's keep the TAG_EDITMSG file around until we are sure the tag has been created successfully. If we die because of an error, the user can recover their text from that file. Leaving the file in place causes no conflicts; it will be silently overwritten by the next annotated tag creation. This matches the behavior of COMMIT_EDITMSG, which stays around in case of error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | gitweb: Make project specific override for 'grep' feature workJakub Narebski2008-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'grep' feature was marked in the comments as having project specific config, but it lacked 'sub' key required for it to work. Kind-of-Noticed-by: Matt Kraai <kraai@ftbfs.org> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | http.c: use 'git_config_string' to get 'curl_http_proxy'Miklos Vajna2008-12-07
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | fetch-pack: Avoid memcpy() with src==dstThomas Rast2008-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memcpy() may only be used for disjoint memory areas, but when invoked from cmd_fetch_pack(), we have my_args == &args. (The argument cannot be removed entirely because transport.c invokes with its own variable.) Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jk/maint-commit-v-strip' into maintJunio C Hamano2008-12-02
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * jk/maint-commit-v-strip: commit: Fix stripping of patch in verbose mode.
| * | | | commit: Fix stripping of patch in verbose mode.Jeff King2008-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the "-v" option is given, we put diff of what is to be committed into the commit template, and then strip it back out again after the user has edited it. We used to look for the diff by searching for the "diff --git a/" header. With diff.mnemonicprefix set in the configuration, however, this pattern does not match. The pattern is loosened to cover this case. Also, if the user puts their own diff in the message (e.g., as a sample output), then we will accidentally trigger the pattern, removing part of their output. We can avoid doing this stripping altogether if the user didn't use "-v" in the first place, so we know that any match we find will be a false positive. [jc: this fix was split out of a series originally meant for master.] Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | xdiff: give up scanning similar lines earlyDavide Libenzi2008-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a corner case of large files whose lines do not match uniquely, the loop to eliminate a line that matches multiple locations adjacent to a run of lines that do not uniquely match wasted too much cycles. Fix this by giving up early after scanning 100 lines in both direction. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'bc/maint-keep-pack' into maintJunio C Hamano2008-12-02
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bc/maint-keep-pack: repack: only unpack-unreachable if we are deleting redundant packs t7700: test that 'repack -a' packs alternate packed objects pack-objects: extend --local to mean ignore non-local loose objects too sha1_file.c: split has_loose_object() into local and non-local counterparts t7700: demonstrate mishandling of loose objects in an alternate ODB builtin-gc.c: use new pack_keep bitfield to detect .keep file existence repack: do not fall back to incremental repacking with [-a|-A] repack: don't repack local objects in packs with .keep file pack-objects: new option --honor-pack-keep packed_git: convert pack_local flag into a bitfield and add pack_keep t7700: demonstrate mishandling of objects in packs with a .keep file
| * | | | | repack: only unpack-unreachable if we are deleting redundant packsBrandon Casey2008-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -A option calls pack-objects with the --unpack-unreachable option so that the unreachable objects in local packs are left in the local object store loose. But if the -d option to repack was _not_ used, then these unpacked loose objects are redundant and unnecessary. Update tests in t7701. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>