summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-01-28run_command(): help callers distinguish errorsJeff King
run_command() returns a single integer specifying either an error code or the exit status of the spawned program. The only way to tell the difference is that the error codes are outside of the allowed range of exit status values. Rather than make each caller implement the test against a magic limit, let's provide a macro. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28run_command(): handle missing command errors more gracefullyJeff King
When run_command() was asked to run a non-existant command, its behavior varied depending on the platform: - on POSIX systems, we would fork, and then after the execvp call failed, we could call die(), which prints a message to stderr and exits with code 128. - on Windows, we do a PATH lookup, realize the program isn't there, and then return ERR_RUN_COMMAND_FORK The goal of this patch is to make it clear to callers that the specific error was a missing command. To do this, we will return the error code ERR_RUN_COMMAND_EXEC, which is already defined in run-command.h, checked for in several places, but never actually gets set. The new behavior is: - on POSIX systems, we exit the forked process with code 127 (the same as the shell uses to report missing commands). The parent process recognizes this code and returns an EXEC error. The stderr message is silenced, since the caller may be speculatively trying to run a command. Instead, we use trace_printf so that somebody interested in debugging can see the error that occured. - on Windows, we check errno, which is already set correctly by mingw_spawnvpe, and report an EXEC error instead of a FORK error Thus it is safe to speculatively run a command: int r = run_command_v_opt(argv, 0); if (r == -ERR_RUN_COMMAND_EXEC) /* oops, it wasn't found; try something else */ else /* we failed for some other reason, error is in r */ Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28git: s/run_command/run_builtin/Jeff King
There is a static function called run_command which conflicts with the library function in run-command.c; this isn't a problem currently, but prevents including run-command.h in git.c. This patch just renames the static function to something more specific and non-conflicting. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-28send-pack: do not send unknown object name from ".have" to pack-objectsJunio C Hamano
v1.6.1 introduced ".have" extension to the protocol to allow the receiving side to advertise objects that are reachable from refs in the repositories it borrows from. This was meant to be used by the sending side to avoid sending such objects; they are already available through the alternates mechanism. The client side implementation in v1.6.1, which was introduced with 40c155f (push: prepare sender to receive extended ref information from the receiver, 2008-09-09) aka v1.6.1-rc1~203^2~1, were faulty in that it did not consider the possiblity that the repository receiver borrows from might have objects it does not know about. This fixes it by refraining from passing missing commits to underlying pack-objects. Revision machinery may need to be tightened further to treat missing uninteresting objects as non-error events, but this is an obvious and safe fix for a maintenance release that is almost good enough. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-27Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: test-path-utils: Fix off by one, found by valgrind get_sha1_basic(): fix invalid memory access, found by valgrind
2009-01-27test-path-utils: Fix off by one, found by valgrindJohannes Schindelin
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>
2009-01-27get_sha1_basic(): fix invalid memory access, found by valgrindJohannes Schindelin
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>
2009-01-25GIT 1.6.1.1v1.6.1.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-24Merge branch 'cb/maint-unpack-trees-absense' into maintJunio C Hamano
* cb/maint-unpack-trees-absense: unpack-trees: remove redundant path search in verify_absent unpack-trees: fix path search bug in verify_absent unpack-trees: handle failure in verify_absent
2009-01-24Merge branch 'tr/maint-no-index-fixes' into maintJunio C Hamano
* tr/maint-no-index-fixes: diff --no-index -q: fix endless loop diff --no-index: test for pager after option parsing diff: accept -- when using --no-index
2009-01-24Merge branch 'rs/maint-shortlog-foldline' into maintJunio C Hamano
* rs/maint-shortlog-foldline: shortlog: handle multi-line subjects like log --pretty=oneline et. al. do
2009-01-24Merge branch 'pj/maint-ldflags' into maintJunio C Hamano
* pj/maint-ldflags: configure clobbers LDFLAGS
2009-01-24Merge branch 'pb/maint-git-pm-false-dir' into maintJunio C Hamano
* pb/maint-git-pm-false-dir: Git.pm: correctly handle directory name that evaluates to "false"
2009-01-24Merge branch 'js/maint-bisect-gitk' into maintJunio C Hamano
* js/maint-bisect-gitk: bisect view: call gitk if Cygwin's SESSIONNAME variable is set
2009-01-24Merge branch 'js/add-not-submodule' into maintJunio C Hamano
* js/add-not-submodule: git add: do not add files from a submodule
2009-01-24Merge branch 'jc/maint-format-patch' into maintJunio C Hamano
* jc/maint-format-patch: format-patch: show patch text for the root commit
2009-01-24Merge branch 'am/maint-push-doc' into maintJunio C Hamano
* am/maint-push-doc: Documentation: avoid using undefined parameters Documentation: mention branches rather than heads Documentation: remove a redundant elaboration Documentation: git push repository can also be a remote
2009-01-24Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: Fix Documentation for git-describe
2009-01-23Fix Documentation for git-describeBoyd Stephen Smith Jr
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>
2009-01-21Rename diff.suppress-blank-empty to diff.suppressBlankEmptyJohannes Schindelin
All the other config variables use CamelCase. This config variable should not be an exception. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-20shell: Document that 'cvs server' is a valid commandLars Noschinski
git-shell's man page explicitly lists all allowed commands, but 'cvs server' was missing. Add it. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Documentation: avoid using undefined parametersAnders Melchiorsen
The <ref> parameter has not been introduced, so rewrite to avoid it. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Documentation: mention branches rather than headsAnders Melchiorsen
The "matching refs" semantics works only on matching branches these days. Instead of using "heads" which traditionally has been used more or less interchangeably with "refs", say "branch" explicitly here. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Documentation: remove a redundant elaborationAnders Melchiorsen
The comment in parentheses is wrong, as one has to leave out both the colon and <dst>. This situation is covered by the section a few lines down: A parameter <ref> without a colon pushes the <ref> from the source repository to the destination repository under the same name. So, just remove the parentheses. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Documentation: git push repository can also be a remoteAnders Melchiorsen
This is copied from pull-fetch-param.txt and helps the reader to not get stuck in the URL section. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Update draft release notes for 1.6.1.1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: builtin-fsck: fix off by one head count Documentation: let asciidoc align related options githooks.txt: add missing word builtin-commit.c: do not remove COMMIT_EDITMSG
2009-01-18builtin-fsck: fix off by one head countChristian Couder
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>
2009-01-18t5540: clarify that http-push does not handle packed-refs on the remoteJohannes Schindelin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18http-push: when making directories, have a trailing slash in the path nameJohannes Schindelin
The function lock_remote() sends MKCOL requests to make leading directories; However, if it does not put a forward slash '/' at the end of the path, the server sends a 301 redirect. By leaving the '/' in place, we can avoid this additional step. Incidentally, at least one version of Curl (7.16.3) does not resend credentials when it follows a 301 redirect, so this commit also fixes a bug. Original patch by Tay Ray Chuan <rctay89@gmail.com>. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18http-push: fix off-by-path_lenJohannes Schindelin
When getting the result of remote_ls(), we were advancing the variable "path" to the relative path inside the repository. However, then we went on to malloc a bogus amount of memory: we were subtracting the prefix length _again_, quite possibly getting something negative, which xmalloc() interprets as really, really much. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18Documentation: let asciidoc align related optionsMarkus Heidelberg
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>
2009-01-18githooks.txt: add missing wordStephan Beyer
Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18builtin-commit.c: do not remove COMMIT_EDITMSGStephan Beyer
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>
2009-01-15Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15t3404: Add test case for auto-amending only edited commits after "edit"Stephan Beyer
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>
2009-01-15t3404: Add test case for aborted --continue after "edit"Stephan Beyer
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>
2009-01-15t3501: check that commits are actually doneStephan Beyer
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>
2009-01-15Update draft release notes to 1.6.1.1Junio C Hamano
2009-01-15Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-15Make t3411 executableMiklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14fix handling of multiple untracked files for git mv -kMichael J Gruber
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>
2009-01-14add test cases for "git mv -k"Michael J Gruber
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>
2009-01-14Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-14fast-import: Cleanup mode setting.Felipe Contreras
"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>
2009-01-14Git.pm: call Error::Simple() properlyJay Soffian
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>
2009-01-13Merge branch 'kk/maint-http-push' into maintJunio C Hamano
* kk/maint-http-push: http-push: support full URI in handle_remote_ls_ctx()
2009-01-13Merge branch 'js/maint-merge-recursive-r-d-conflict' into maintJunio C Hamano
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
2009-01-13Merge branch 'cb/maint-merge-recursive-fix' into maintJunio C Hamano
* cb/maint-merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file Conflicts: builtin-merge-recursive.c
2009-01-13Merge branch 'ap/maint-apply-modefix' into maintJunio C Hamano
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes