summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-01-13unpack-trees: handle lstat failure for existing fileJonathan Nieder
When check_leading_path notices a file in the way of a new entry to be checked out, verify_absent uses (1) the mode to determine whether it is a directory (2) the rest of the stat information to check if this is actually an old entry, disguised by a change in filename (e.g., README -> Readme) that is significant to git but insignificant to the underlying filesystem. If lstat fails, these checks are performed with an uninitialied stat structure, producing essentially random results. Better to just error out when lstat fails. The easiest way to reproduce this is to remove a file after the check_leading_path call and before the lstat in verify_absent. An lstat failure other than ENOENT in check_leading_path would also trigger the same code path. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-13unpack-trees: handle lstat failure for existing directoryJonathan Nieder
When check_leading_path notices no file in the way of the new entry to be checked out, verify_absent checks whether there is a directory there or nothing at all. If that lstat call fails (for example due to ENOMEM), it assumes ENOENT, meaning a directory with untracked files would be clobbered in that case. Check errno after calling lstat, and for conditions other than ENOENT, just error out. This is a theoretical race condition. lstat has to succeed moments before it fails for there to be trouble. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-12commit: suggest --amend --reset-author to fix commiter identityMatthieu Moy
Since the message advises to fix the configuration first, the advantage of using this command is that it is cut-and-paste ready, while using --author='...' requires the user to type his name and email again. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Merge branch 'maint-1.7.2' into maintJunio C Hamano
* maint-1.7.2: Documentation/githooks: post-rewrite-copy-notes never existed Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Merge branch 'maint-1.7.1' into maint-1.7.2Junio C Hamano
* maint-1.7.1: Documentation/githooks: post-rewrite-copy-notes never existed Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Merge branch 'maint-1.7.0' into maint-1.7.1Junio C Hamano
* maint-1.7.0: Documentation/git-archive: spell --worktree-attributes correctly
2011-01-10Documentation/githooks: post-rewrite-copy-notes never existedThomas Rast
The documentation for the post-rewrite hook contains a paragraph from its early development, where the automatic notes copying facilities were not part of the series and thus this had to be a hook. Later versions of the series implemented notes copying as a core feature. Thus mentioning post-rewrite-copy-notes was never correct. As the other hooks do not have a "there is no default hook, but..." sentence unless they ship a sample hook in either templates or contrib, we simply remove the whole paragraph. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-10Documentation/git-archive: spell --worktree-attributes correctlyThomas Rast
The --worktree-attributes option was correctly documented in ba053ea (archive: do not read .gitattributes in working directory, 2009-04-18). However, later in 9b4c8b0 (archive documentation: attributes are taken from the tree by default, 2010-02-10) the misspelling "--work-tree-attributes" was used to refer to it. Fix this. Noticed-by: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-09Mark gitk script executableAnders Kaseorg
The executable bit on gitk-git/gitk was lost (accidentally it seems) by commit 62ba5143ec2ab9d4083669b1b1679355e7639cd5. Put it back, so that gitk can be run directly from a git.git checkout. Note that the script is already executable in gitk.git, just not in git.git. Signed-off-by: Anders Kaseorg <andersk@mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-05Git 1.7.3.5v1.7.3.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-01-04gitweb: skip logo in atom feed when there is noneJonathan Nieder
With v1.5.0-rc0~169 (gitweb: Fix Atom feed <logo>: it is $logo, not $logo_url, 2006-12-04), the logo URI to be written to Atom feeds was corrected but the case of no logo forgotten. Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-29t9001: Fix test prerequisitesRobin H. Johnson
Add in missing Perl prerequisites for new tests of send-email. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28Prepare for 1.7.3.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-28Merge branch 'jk/commit-die-on-bogus-ident' into maintJunio C Hamano
* jk/commit-die-on-bogus-ident: commit: die before asking to edit the log message ident: die on bogus date format
2010-12-28Merge branch 'ks/blame-worktree-textconv-cached' into maintJunio C Hamano
* ks/blame-worktree-textconv-cached: fill_textconv(): Don't get/put cache if sha1 is not valid t/t8006: Demonstrate blame is broken when cachetextconv is on
2010-12-28Merge branch 'jc/maint-rebase-rewrite-last-skip' into maintJunio C Hamano
* jc/maint-rebase-rewrite-last-skip: rebase --skip: correctly wrap-up when skipping the last patch
2010-12-28Merge branch 'jc/maint-am-abort-safely' into maintJunio C Hamano
* jc/maint-am-abort-safely: am --abort: keep unrelated commits since the last failure and warn
2010-12-28Merge branch 'kb/maint-status-cquote' into maintJunio C Hamano
* kb/maint-status-cquote: status: Quote paths with spaces in short format
2010-12-28Fix false positives in t3404 due to SHELL=/bin/falseRobin H. Johnson
If the user's shell in NSS passwd is /bin/false (eg as found during Gentoo's package building), the git-rebase exec tests will fail, because they call $SHELL around the command, and in the existing testcase, $SHELL was not being cleared sufficently. This lead to false positive failures of t3404 on systems where the package build user was locked down as noted above. Signed-off-by: "Robin H. Johnson" <robbat2@gentoo.org> X-Gentoo-Bug: 349083 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=349083 Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-26Merge branch 'rs/maint-diff-fd-leak' into maintJunio C Hamano
* rs/maint-diff-fd-leak: close file on error in read_mmfile()
2010-12-26close file on error in read_mmfile()René Scharfe
Reported in http://qa.debian.org/daca/cppcheck/sid/git_1.7.2.3-2.2.html and in http://thread.gmane.org/gmane.comp.version-control.git/123042. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-23test-lib.sh/test_decode_color(): use octal not hex in awk scriptBrandon Casey
POSIX awk seems to explicitly not support hexadecimal escape sequences. From http://pubs.opengroup.org/onlinepubs/009695399/: Regular expressions in awk have been extended somewhat... One sequence that is not supported is hexadecimal value escapes beginning with '\x'. This affects the awk on IRIX 6.5, and causes t4015.56 to fail. Use octal instead. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-23rebase --skip: correctly wrap-up when skipping the last patchJunio C Hamano
When "rebase --skip" is used to skip the last patch in the series, the code to wrap up the rewrite by copying the notes from old to new commits and also by running the post-rewrite hook was bypassed. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21t0050: fix printf format strings for portabilityJonathan Nieder
Unlike bash and ksh, dash passes through hexadecimal \xcc escapes. So when run with dash, these tests *pass* (since '\xcc' is a perfectly reasonable filename) but they are not testing what was intended. Use octal escapes instead, in the spirit of v1.6.1-rc1~55^2 (2008-11-09). Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21t3419-*.sh: Fix arithmetic expansion syntax errorRamsay Jones
Some shells, for example dash versions older than 0.5.4, need to spell a variable reference as '$N' rather than 'N' in an arithmetic expansion. In order to avoid the syntax error, we change the offending variable reference from 'i' to '$i' in function scramble. There is nothing bash specific to this test script (and we shouldn't have any bash dependent test). Fix its shebang line. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21am --abort: keep unrelated commits since the last failure and warnJunio C Hamano
After making commits (either by pulling or doing their own work) after a failed "am", the user will be reminded by next "am" invocation that there was a failed "am" that the user needs to decide to resolve or to get rid of the old "am" attempt. The "am --abort" option was meant to help the latter. However, it rewinded the HEAD back to the beginning of the failed "am" attempt, discarding commits made (perhaps by mistake) since. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-21commit: die before asking to edit the log messageJunio C Hamano
When determine_author_info() returns to the calling prepare_to_commit(), we already know the pieces of information necessary to determine what author ident will be used in the final message, but deferred making a call to fmt_ident() before the final commit_tree(). Most importantly, we would open the editor to ask the user to compose the log message before it. As one important side effect of fmt_ident() is to error out when the given information is malformed, this resulted in us spawning the editor first and then refusing to commit due to error, even though we had enough information to detect the error before starting the editor, which was annoying. Move the fmt_ident() call to the end of determine_author_info() where we have final determination of author info to rectify this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-20ident: die on bogus date formatJeff King
If the user gives "git commit --date=foobar", we silently ignore the --date flag. We should note the error. This patch puts the fix at the lowest level of fmt_ident, which means it also handles GIT_AUTHOR_DATE=foobar, as well. There are two down-sides to this approach: 1. Technically this breaks somebody doing something like "git commit --date=now", which happened to work because bogus data is the same as "now". Though we do explicitly handle the empty string, so anybody passing an empty variable through the environment will still work. If the error is too much, perhaps it can be downgraded to a warning? 2. The error checking happens _after_ the commit message is written, which can be annoying to the user. We can put explicit checks closer to the beginning of git-commit, but that feels a little hack-ish; suddenly git-commit has to care about how fmt_ident works. Maybe we could simply call fmt_ident earlier? Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-20fill_textconv(): Don't get/put cache if sha1 is not validKirill Smelkov
When blaming files in the working tree, the filespec is marked with !sha1_valid, as we have not given the contents an object name yet. The function to cache textconv results (keyed on the object name), however, didn't check this condition, and ended up on storing the cached result under a random object name. Cc: Axel Bonnet <axel.bonnet@ensimag.imag.fr> Cc: Clément Poulain <clement.poulain@ensimag.imag.fr> Cc: Diane Gasselin <diane.gasselin@ensimag.imag.fr> Cc: Jeff King <peff@peff.net> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-20t/t8006: Demonstrate blame is broken when cachetextconv is onKirill Smelkov
I have a git repository with lots of .doc and .pdf files. There diff works ok, but blaming is painfully slow without textconv cache, and with textconv cache, blame says lots of lines are 'Not Yet Committed' which is wrong. Here is a test that demonstrates the problem. Cc: Axel Bonnet <axel.bonnet@ensimag.imag.fr> Cc: Clément Poulain <clement.poulain@ensimag.imag.fr> Cc: Diane Gasselin <diane.gasselin@ensimag.imag.fr> Cc: Jeff King <peff@peff.net> Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19gitweb: Include links to feeds in HTML header only for '200 OK' responseJakub Narebski
To do that, generating "<link />"s to feeds were refactored into print_feed_meta() subroutine, to keep nesting (indent) level in git_header_html() low. This has also the advantage of making code more clear. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19fsck docs: remove outdated and useless diagnosticMark Lodato
In git-fsck(1), there was a reference to the warning "<tree> has full pathnames in it". This exact wording has not been used since 2005 (commit f1f0d0889e55), when the wording was changed slightly. More importantly, the description of that warning was useless, and there were many other similar warning messages which were not document at all. Since all these warnings are fairly obvious, there is no need for them to be in the man page. Signed-off-by: Mark Lodato <lodatom@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-19userdiff: fix typo in ruby and python word regexesThomas Rast
Both had an unclosed ] that ruined the safeguard against not matching a non-space char. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-17trace.c: mark file-local function staticVasyl' Vavrychuk
Signed-off-by: Vasyl' Vavrychuk <vvavrychuk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-17Fix typo in git-gc document.Jiang Xin
The variable gc.packrefs for git-gc can be set to true, false and "notbare", not "nobare". Signed-off-by: Jiang Xin <jiangxin@ossxp.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-16difftool: provide basename to external toolsMichael J Gruber
Currently, only configured diff helpers get the basename of the file being compared. Tools specified with "git difftool -x" only get the names of temporary files for the different versions. Export BASE so that an external tool can read the name from the environment. Rather than using a third argument, this avoids breaking existing scripts which may somewhat carelessly be using "$@" rather than "$1" "$2". Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-16git-difftool.txt: correct the description of $BASE and describe $MERGEDMichael J Gruber
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.7.3.4v1.7.3.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.7.2.5v1.7.2.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.7.1.4v1.7.1.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.7.0.9v1.7.0.9Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.6.3v1.6.6.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.5.9v1.6.5.9Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15Git 1.6.4.5v1.6.4.5Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-15gitweb: Introduce esc_attr to escape attributes of HTML elementsJakub Narebski
It is needed only to escape attributes of handcrafted HTML elements, and not those generated using CGI.pm subroutines / methods for HTML generation. While at it, add esc_url and esc_html where needed, and prefer to use CGI.pm HTML generating methods than handcrafted HTML code. Most of those are probably unnecessary (could be exploited only by person with write access to gitweb config, or at least access to the repository). This fixes CVE-2010-3906 Reported-by: Emanuele Gentili <e.gentili@tigersecurity.it> Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-14Prepare for 1.7.3.4Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-14use persistent memory for rejected pathsClemens Buchacher
An aborted merge prints the list of rejected paths as part of the error message. Since commit f66caaf9 (do not overwrite files in leading path), some of those paths do not have static buffers, so we have to keep a copy. Use string_list's to accomplish this. This changes the order of the list to the order in which the paths are processed. Previously, it was reversed. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-14do not overwrite files in leading pathClemens Buchacher
If the work tree contains an untracked file x, and unpack-trees wants to checkout a path x/*, the file x is removed unconditionally. Instead, apply the same checks that are normally used for untracked files, and abort if the file cannot be removed. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-14lstat_cache: optionally return match_lenClemens Buchacher
Return match_len so that the caller can know which leading path component matched. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-12-14add function check_ok_to_remove()Clemens Buchacher
This wraps some inline code into the function check_ok_to_remove(), which will later be used for leading path components as well. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>