aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Fix grammar nits in documentation and in code comments.Jim Meyering2008-01-03
| | | | | Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Uninline prefixcmp()Junio C Hamano2008-01-03
| | | | | | | | | Now the routine is an open-coded loop that avoids an extra strlen() in the previous implementation, it got a bit too big to be inlined. Uninlining it makes code footprint smaller but the result still retains the avoidance of strlen() cost. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Update callers of check_ref_format()Junio C Hamano2008-01-02
| | | | | | | | | | This updates send-pack and fast-import to use symbolic constants for checking the return values from check_ref_format(), and also futureproof the logic in lock_any_ref_for_update() to explicitly name the case that is usually considered an error but is Ok for this particular use. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: unlink index files that were globbed, tooEric Wong2008-01-02
| | | | | | | | | | | | commit 3157dd9e89a71e80673d0bc21b5c0630f3b1fe68 (git-svn: unlink internal index files after operations) introduced unlinking index files after fetching. However, this missed indices for refs that were created by globbing branches and tags. This will track all refs we ever touch during a fetch and unlink them at exit time. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: allow dcommit --no-rebase to commit multiple, dependent changesEric Wong2008-01-02
| | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* receive-pack: check object type of sha1 before using them as commitsMartin Koegler2008-01-02
| | | | | Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Optimize prefixcmp()Johannes Schindelin2008-01-02
| | | | | | | | | | | Certain codepaths (notably "git log --pretty=format...") use prefixcmp() extensively, with very short prefixes. In those cases, calling strlen() is a wasteful operation, so avoid it. Initial patch by Marco Costalba. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* lock_any_ref_for_update(): reject wildcard return from check_ref_formatJunio C Hamano2008-01-02
| | | | | | | | | | | | | | Recent check_ref_format() returns -3 as well as -1 (general error) and -2 (less than two levels). The caller was explicitly checking for -1, to allow "HEAD" but still needed to disallow bogus refs. This introduces symbolic constants for the return values from check_ref_format() to make them read better and more meaningful. Normal ref creation codepath can still treat non-zero return values as errors. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-reset: refuse to do hard reset in a bare repositoryJeff King2008-01-02
| | | | | | | | It makes no sense since there is no working tree. A soft reset should be fine, though. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: handle lack of newline at end of file betterJeff King2008-01-02
| | | | | | | | | | | | | | | | | | | | | | | | The config parsing routines use the static global 'config_file' to store the FILE* pointing to the current config file being parsed. The function get_next_char() automatically converts an EOF on this file to a newline for the convenience of its callers, and it sets config_file to NULL to indicate that EOF was reached. This throws away useful information, though, since some routines want to call ftell on 'config_file' to find out exactly _where_ the routine ended. In the case of a key ending at EOF boundary, we ended up segfaulting in some cases (changing that key or adding another key in its section), or failing to provide the necessary newline (adding a new section). This patch adds a new flag to indicate EOF and uses that instead of setting config_file to NULL. It also makes sure to add newlines where necessary for truncated input. All three included tests fail without the patch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint' of git://linux-nfs.org/~bfields/gitJunio C Hamano2007-12-31
|\ | | | | | | | | | | * 'maint' of git://linux-nfs.org/~bfields/git: Documentation/user-manual.txt: fix typo Documentation: fix remote.<name>.skipDefaultUpdate description
| * Documentation/user-manual.txt: fix typoGustaf Hendeby2007-12-31
| | | | | | | | | | Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
| * Documentation: fix remote.<name>.skipDefaultUpdate descriptionJ. Bruce Fields2007-12-31
| | | | | | | | | | | | Fix the subcommand name. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
* | git-rebase -i: clean-up error check codepath.Junio C Hamano2007-12-30
| | | | | | | | | | | | | | | | | | After replaying a single change, the code performed a number of checks, but some of them were for sanity checking, failures from which should make the command abort, and others were checks to see if it should make a new commit object. Stringing them together with "&&" was wrong. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-rebase -i behaves better on commits with incomplete messagesJunio C Hamano2007-12-30
| | | | | | | | | | | | | | | | | | | | The commit message template when squashing multiple commits is prepared by concatenating the messages of existing commits together. If the messages from some of them end with incomplete lines, this would result in a suboptimal message template. Make sure that we add a terminating LF after each commit message. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix double-free() in http-push.c:remote_exists()Grégoire Barbier2007-12-30
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | "git pull --tags": error out with a better message.Junio C Hamano2007-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When "git pull --tags" is run without any other arguments, the standard error message "You told me to fetch and merge stuff but there is nothing to merge! You might want to fix your config" is given. While the error may be technically correct, fixing the config would not help, as "git pull --tags" itself tells "git fetch" not to use the configured refspecs. This commit makes "git pull --tags" to issue a different error message to avoid confusion. This is merely an interim solution. In the longer term, it would be a better approach to change the semantics of --tags option to make "git fetch" and "git pull" to: (1) behave as if no --tags was given (so an explicit refspec on the command line overrides configured ones, or no explicit refspecs on the command line takes configured ones); but (2) no auto-following of tags is made even when using configured refspecs; and (3) fetch all tags as not-for-merge entries". Then we would not need to have this separate error message, as the ordinary merge will happen even with the --tags option. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-sh-setup: document git_editor() and get_author_ident_from_commit()Miklos Vajna2007-12-28
| | | | | | | | | | | | | | These 2 functions were missing from the manpage. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation/git-submodule.txt: typofixJunio C Hamano2007-12-27
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | GIT 1.5.4-rc2v1.5.4-rc2Junio C Hamano2007-12-26
| | | | | | | | | | | | | | Although everybody was quiet during the Christmas holiday, it's been a week since -rc1, so here is -rc2. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/pretty-safety'Junio C Hamano2007-12-26
|\ \ | | | | | | | | | | | | * rs/pretty-safety: Make "--pretty=format" parser a bit more careful.
| * | Make "--pretty=format" parser a bit more careful.René Scharfe2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a commit message that does not have a terminating LF is read in and the memory that was allocated to read it happens to have a LF immediately after that, the code was not careful and went past the terminating NUL. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | contrib: resurrect scripted git-revert.Junio C Hamano2007-12-26
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ar/commit-cleanup'Junio C Hamano2007-12-26
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ar/commit-cleanup: Allow selection of different cleanup modes for commit messages builtin-commit: avoid double-negation in the code. builtin-commit: fix amending of the initial commit t7005: do not exit inside test.
| * | | Allow selection of different cleanup modes for commit messagesAlex Riesen2007-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although we traditionally stripped away excess blank lines, trailing whitespaces and lines that begin with "#" from the commit log message, sometimes the message just has to be the way user wants it. For instance, a commit message template can contain lines that begin with "#", the message must be kept as close to its original source as possible if you are converting from a foreign SCM, or maybe the message has a shell script including its comments for future reference. The cleanup modes are default, verbatim, whitespace and strip. The default mode depends on if the message is being edited and will either strip whitespace and comments (if editor active) or just strip the whitespace (for where the message is given explicitely). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin-commit: avoid double-negation in the code.Junio C Hamano2007-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The flag no_edit meant "we have got final message from the user and will not editing it any further", but there were quite a few places that needed to check !no_edit. Rename the variable to use_editor and reverse the logic everywhere. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | builtin-commit: fix amending of the initial commitJunio C Hamano2007-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When amending initial commit without editor, the command incorrectly barfed because the check to see if there is anything to commit referenced the non-existent HEAD^1. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | t7005: do not exit inside test.Junio C Hamano2007-12-22
| |/ / | | | | | | | | | | | | | | | | | | The way to signal failure is to leave non-zero in $?, not abort the entire test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Fix rewrite_diff() name quoting.Junio C Hamano2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the logic to quote two paths (prefix + path) in C-style introduced in the previous commit from the dump_quoted_path() in combine-diff.c to quote.c, and uses it to fix rewrite_diff() that never C-quoted the pathnames correctly. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | combine-diff: Fix path quotingJunio C Hamano2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier when showing combined diff, the filenames on the ---/+++ header lines were quoted incorrectly. a/ (or b/) prefix was output literally and then the path was output, with c-quoting. This fixes the quoting logic, and while at it, adjusts the code to use the customizable prefix (a_prefix and b_prefix) introduced recently. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Fix documentation of --first-parent in git-log and copy it to git-rev-listJunio C Hamano2007-12-26
| | | | | | | | | | | | | | | | | | | | | Credit goes to Avi Kivity for noticing the lack of description in rev-list manual page. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Fix "git log --diff-filter" bugArjen Laarhoven2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b7bb760d5ed4881422673d32f869d140221d3564 (Fix revision log diff setup, avoid unnecessary diff generation) an optimization was made to avoid unnecessary diff generation. This was partly fixed in 99516e35d096f41e7133cacde8fbed8ee9a3ecd0 (Fix embarrassing "git log --follow" bug). The '--diff-filter' option also needs the diff machinery in action. Signed-off-by: Arjen Laarhoven <arjen@yaph.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Improve error messages when int/long cannot be parsed from configShawn O. Pearce2007-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a config file has become mildly corrupted due to a missing LF we may discover some other option joined up against the end of a numeric value. For example: [section] number = 1auto where the "auto" flag was meant to occur on the next line, below "number", but the missing LF has caused it to no longer be its own option. Instead the word "auto" is parsed as a 'unit factor' for the value of "number". Before this change we got the confusing error message: fatal: unknown unit: 'auto' which told us nothing about where the problem appeared. Now we get: fatal: bad config value for 'aninvalid.unit' which at least points the user in the right direction of where to search for the incorrectly formatted configuration file. Noticed by erikh on #git, which received the original error from a simple `git checkout -b` due to a midly corrupted config. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | cvsimport: die on cvsps errorsJeff King2007-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were not previously checking the exit status of cvsps at all. If it exited before producing any useful output, we ended up with an empty import, which caused a spew of confusing error messages from other parts of git: $ git-cvsimport foo Initialized empty Git repository in ... some error from cvsps fatal: refs/heads/origin: not a valid SHA1 fatal: master: not a valid SHA1 warning: You appear to be on a branch yet to be born. warning: Forcing checkout of HEAD. fatal: just how do you expect me to merge 0 trees? checkout failed: 256 Now we get: $ git-cvsimport foo Initialized empty Git repository in ... some error from cvsps git-cvsimport: fatal: cvsps reported error Signed-off-by: Jeff King <peff@peff.net> Acked-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | shortlog manpage documentation: work around asciidoc markup issuesGustaf Hendeby2007-12-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We wanted to have a list in which one (and the sole, as it happen to be) item in it is ".mailmap", but do not seem to be able to convince AsciiDoc to format it correctly for manpages. Reformat it into a paragraph that describes the said file to work around the issue. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Documentation: describe 'union' low-level merge driverJunio C Hamano2007-12-22
|/ / | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Don't dereference NULL upon lookup failure.Jim Meyering2007-12-22
| | | | | | | | | | | | | | | | Instead, signal the error just like the case we do upon encountering an object with an unknown type. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Emit helpful status for accidental "git stash" saveWincent Colaiuta2007-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | If the user types "git stash" mistakenly thinking that this will list their stashes he/she may be surprised to see that it actually saved a new stash and reset their working tree and index. In the worst case they might not know how to recover the state. So help them by telling them exactly what was saved and also how to restore it immediately. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | parse-options: Add a gitcli(5) man page.Pierre Habouzit2007-12-22
| | | | | | | | | | | | | | This page should hold every information about the git ways to parse command lines, and best practices to be used for scripting. Signed-off-by: Pierre Habouzit <madcoder@debian.org>
* | Force the sticked form for options with optional arguments.Pierre Habouzit2007-12-22
| | | | | | | | | | | | | | This forbids "git tag -n <number> -l" we allowed earlier, so adjust t7004 while at it. Signed-off-by: Pierre Habouzit <madcoder@debian.org>
* | Fix $EDITOR regression introduced by rewrite in C.Junio C Hamano2007-12-22
| | | | | | | | | | | | | | | | | | | | When git-tag and git-commit launches the editor, they used to honor EDITOR="editor -options args..." but recent rewrite in C insisted on $EDITOR to be the path to the editor executable. This restores the older behaviour. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Small comment fix for git-cvsimport.Stefan Sperling2007-12-22
| | | | | | | | | | Signed-off-by: Stefan Sperling <stsp@stsp.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make git send-email accept $EDITOR with argumentsGustaf Hendeby2007-12-22
| | | | | | | | | | | | | | | | | | Currently git send-email does not accept $EDITOR with arguments, eg, emacs -nw, when starting an editor to produce a cover letter. This patch changes this by letting the shell handle the option parsing. Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-tag: fix -l switch handling regression.Pierre Habouzit2007-12-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The command itself takes an optional <pattern> argument that limits the shown tags to the ones that match when in listing mode that is triggered with '-l' option. The <pattern> is not an optional option-argument to '-l'. With this fix, "git tag -l -n 4 v0.99" works as expected. It also removes a few bogus tests in t7004. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: ls-files -v is about "assume unchanged".Junio C Hamano2007-12-21
| | | | | | | | | | | | And refer the reader to update-index documentation. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Re(-re)*fix trim_common_tail()Linus Torvalds2007-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tar-ball and the git archive itself is fine, but yes, the diff from 2.6.23 to 2.6.24-rc6 is bad. It's the "trim_common_tail()" optimization that has caused way too much pain. Very interesting breakage. The patch was actually "correct" in a (rather limited) technical sense, but the context at the end was missing because while the trim_common_tail() code made sure to keep enough common context to allow a valid diff to be generated, the diff machinery itself could decide that it could generate the diff differently than the "obvious" solution. Thee sad fact is that the git optimization (which is very important for "git blame", which needs no context), is only really valid for that one case where we really don't need any context. [jc: since this is shared with "git diff -U0" codepath, context recovery to the end of line needs to be done even for zero context case.] Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: fix whitespace in config_to_multi (indent with tab)Jakub Narebski2007-12-20
| | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | everyday: replace 'prune' and 'repack' with 'gc'Miklos Vajna2007-12-20
| | | | | | | | | | | | | | | | | | In everyday tasks, "repack -a -d -f" won't be used, so there is not much point mentioning "repack". By showing the --prune option to "gc", we can do without mentioning "git prune", too. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Remove old generated files from .gitignore.Charles Bailey2007-12-20
| | | | | | | | | | | | | | | | | | | | Some entries in .gitignore are obselete. These should be cleaned up just for the sake of general tidiness and so that any developers who have a working tree that was moved forward without a clean know that they have old stuff in their work tree. Signed-off-by: Charles Bailey <charles@hashpling.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | clean up 1.5.4 release notesJeff King2007-12-20
| | | | | | | | | | | | | | | | Mostly typo and small grammatical fixes with one or two rewordings for clarity. But note the important fix for status.relativepaths. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>