Go to file
Jeff King 45c0961c87 run_command(): handle missing command errors more gracefully
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-28 14:08:57 -08:00
Documentation GIT 1.6.1.1 2009-01-25 12:41:09 -08:00
arm
compat Merge branch 'js/mingw-rename-fix' 2008-11-27 19:25:06 -08:00
contrib Merge branch 'maint-1.6.0' into maint 2009-01-13 00:40:19 -08:00
git-gui Merge git://repo.or.cz/git-gui 2008-12-17 21:56:48 -08:00
gitk-git Merge git://git.kernel.org/pub/scm/gitk/gitk 2008-12-21 18:31:12 -08:00
gitweb gitweb: Fix export check in git_get_projects_list 2008-12-27 22:34:03 -08:00
mozilla-sha1
perl Merge branch 'pb/maint-git-pm-false-dir' into maint 2009-01-23 19:02:41 -08:00
ppc
t send-pack: do not send unknown object name from ".have" to pack-objects 2009-01-27 23:46:59 -08:00
templates
xdiff xdiff: give up scanning similar lines early 2008-12-02 23:45:37 -08:00
.gitattributes
.gitignore add stage to gitignore 2008-12-03 21:29:03 -08:00
.mailmap
COPYING
GIT-VERSION-GEN GIT 1.6.1.1 2009-01-25 12:41:09 -08:00
INSTALL
Makefile Enable threaded delta search on Mac OS X/Darwin 2008-12-17 22:01:20 -08:00
README README: tutorial.txt is now called gittutorial.txt 2009-01-06 22:12:07 -08:00
RelNotes Prepare for v1.6.1.1 maintenance release 2008-12-29 01:17:34 -08:00
abspath.c make_absolute_path(): check bounds when seeing an overlong symlink 2008-12-17 13:36:34 -08:00
alias.c
alloc.c
archive-tar.c
archive-zip.c
archive.c
archive.h
attr.c
attr.h
base85.c
blob.c
blob.h
branch.c
branch.h
builtin-add.c git add: do not add files from a submodule 2009-01-05 10:48:32 -08:00
builtin-annotate.c
builtin-apply.c Merge branch 'ap/maint-apply-modefix' into maint 2009-01-13 00:56:40 -08:00
builtin-archive.c
builtin-blame.c builtin-blame.c: use strbuf_readlink() 2008-12-17 13:36:35 -08:00
builtin-branch.c git-branch: display sha1 on branch deletion 2008-12-12 20:42:59 -08:00
builtin-bundle.c
builtin-cat-file.c
builtin-check-attr.c
builtin-check-ref-format.c
builtin-checkout-index.c
builtin-checkout.c Merge branch 'jc/maint-do-not-switch-to-non-commit' into maint 2009-01-11 23:24:42 -08:00
builtin-clean.c
builtin-clone.c builtin_clone: use strbuf in cmd_clone() 2008-11-25 15:34:26 -08:00
builtin-commit-tree.c
builtin-commit.c Merge branch 'maint-1.6.0' into maint 2009-01-17 22:39:49 -08:00
builtin-config.c
builtin-count-objects.c
builtin-describe.c Merge branch 'sp/maint-describe-all-tag-warning' into maint 2008-12-27 14:21:15 -08:00
builtin-diff-files.c Add cache preload facility 2008-11-14 19:11:49 -08:00
builtin-diff-index.c
builtin-diff-tree.c
builtin-diff.c reorder ALLOW_TEXTCONV option setting 2008-12-07 19:59:25 -08:00
builtin-fast-export.c fast-export: print usage when no options specified 2009-01-03 14:24:15 -08:00
builtin-fetch--tool.c
builtin-fetch-pack.c Merge branch 'maint' 2008-12-07 15:13:02 -08:00
builtin-fetch.c Teach/Fix pull/fetch -q/-v options 2008-11-14 17:18:32 -08:00
builtin-fmt-merge-msg.c
builtin-for-each-ref.c
builtin-fsck.c Merge branch 'maint-1.6.0' into maint 2009-01-17 22:39:49 -08:00
builtin-gc.c Merge branch 'bc/maint-keep-pack' 2008-11-12 22:00:43 -08:00
builtin-grep.c
builtin-help.c
builtin-http-fetch.c
builtin-init-db.c
builtin-log.c Merge branch 'jc/maint-format-patch' into maint 2009-01-23 18:59:59 -08:00
builtin-ls-files.c Teach ls-files --with-tree=<tree> to work with options other than -c 2008-11-16 00:15:50 -08:00
builtin-ls-remote.c
builtin-ls-tree.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-merge-base.c
builtin-merge-file.c merge-file: handle freopen() failure 2008-12-26 19:10:02 -08:00
builtin-merge-ours.c
builtin-merge-recursive.c merge-recursive: do not clobber untracked working tree garbage 2008-12-15 02:39:57 -08:00
builtin-merge.c Make some of fwrite/fclose/write/close failures visible 2008-12-04 18:05:41 -08:00
builtin-mv.c fix handling of multiple untracked files for git mv -k 2009-01-14 09:34:22 -08:00
builtin-name-rev.c
builtin-pack-objects.c Merge branch 'maint' 2008-12-11 00:36:31 -08:00
builtin-pack-refs.c
builtin-prune-packed.c
builtin-prune.c
builtin-push.c
builtin-read-tree.c checkout: Fix "initial checkout" detection 2008-11-12 14:16:50 -08:00
builtin-receive-pack.c
builtin-reflog.c
builtin-remote.c git-remote: add verbose mode to git remote update 2008-11-18 15:38:34 -08:00
builtin-rerere.c
builtin-reset.c
builtin-rev-list.c
builtin-rev-parse.c
builtin-revert.c git-revert: record the parent against which a revert was made 2008-12-21 18:32:04 -08:00
builtin-rm.c git add --intent-to-add: fix removal of cached emptiness 2008-11-28 19:58:24 -08:00
builtin-send-pack.c send-pack: do not send unknown object name from ".have" to pack-objects 2009-01-27 23:46:59 -08:00
builtin-shortlog.c shortlog: handle multi-line subjects like log --pretty=oneline et. al. do 2009-01-06 22:06:07 -08:00
builtin-show-branch.c
builtin-show-ref.c
builtin-stripspace.c
builtin-symbolic-ref.c
builtin-tag.c Merge branch 'maint' 2008-12-07 15:13:02 -08:00
builtin-tar-tree.c
builtin-unpack-objects.c
builtin-update-index.c
builtin-update-ref.c
builtin-upload-archive.c
builtin-verify-pack.c
builtin-verify-tag.c
builtin-write-tree.c git add --intent-to-add: do not let an empty blob be committed by accident 2008-11-30 17:59:19 -08:00
builtin.h
bundle.c
bundle.h
cache-tree.c git add --intent-to-add: do not let an empty blob be committed by accident 2008-11-30 17:59:19 -08:00
cache-tree.h
cache.h Merge branch 'maint' 2008-12-11 00:36:31 -08:00
check-builtins.sh
check-racy.c
check_bindir
color.c
color.h
combine-diff.c combine-diff.c: use strbuf_readlink() 2008-12-17 13:36:35 -08:00
command-list.txt
commit.c
commit.h
config.c Get rid of the last remnants of GIT_CONFIG_LOCAL 2008-12-14 16:43:39 -08:00
config.mak.in Makefile: introduce NO_PTHREADS 2008-12-02 15:29:12 -08:00
configure.ac configure clobbers LDFLAGS 2009-01-05 19:46:19 -08:00
connect.c connect.c: stricter port validation, silence compiler warning 2008-12-21 01:48:23 -08:00
convert.c
copy.c
csum-file.c
csum-file.h
ctype.c
daemon.c daemon: cleanup: factor out xstrdup_tolower() 2008-12-26 19:09:56 -08:00
date.c date/time: do not get confused by fractional seconds 2008-11-13 09:06:58 -08:00
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c
diff-no-index.c diff --no-index -q: fix endless loop 2009-01-07 12:04:38 -08:00
diff.c Rename diff.suppress-blank-empty to diff.suppressBlankEmpty 2009-01-21 00:17:40 -08:00
diff.h
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h
dir.c
dir.h
dump-cache-tree.c
editor.c
entry.c
environment.c Add cache preload facility 2008-11-14 19:11:49 -08:00
exec_cmd.c
exec_cmd.h
fast-import.c Merge branch 'maint-1.6.0' into maint 2009-01-13 23:10:50 -08:00
fetch-pack.h
fixup-builtins
fsck.c
fsck.h
generate-cmdlist.sh generate-cmdlist.sh: avoid selecting synopsis at wrong place 2008-11-30 18:16:32 -08:00
git-add--interactive.perl
git-am.sh git-am: rename apply_opt_extra file to apply-opt 2008-12-05 20:02:10 -08:00
git-archimport.perl
git-bisect.sh bisect view: call gitk if Cygwin's SESSIONNAME variable is set 2009-01-03 14:25:27 -08:00
git-compat-util.h
git-cvsexportcommit.perl
git-cvsimport.perl
git-cvsserver.perl
git-filter-branch.sh filter-branch: use git rev-parse -q 2008-12-03 14:27:17 -08:00
git-instaweb.sh
git-lost-found.sh lost-found: use git rev-parse -q 2008-12-03 14:27:17 -08:00
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool.sh git-mergetool: properly handle "git mergetool -- filename" 2008-12-19 19:10:58 -08:00
git-parse-remote.sh
git-pull.sh pull: use git rev-parse -q 2008-12-03 14:27:17 -08:00
git-quiltimport.sh
git-rebase--interactive.sh Merge branch 'maint-1.6.0' into maint 2009-01-13 00:40:19 -08:00
git-rebase.sh rebase: improve error messages about dirty state 2008-12-10 19:07:35 -08:00
git-relink.perl
git-repack.sh repack: only unpack-unreachable if we are deleting redundant packs 2008-11-14 21:39:10 -08:00
git-request-pull.sh request-pull: make usage string match manpage 2008-11-17 02:27:18 -08:00
git-send-email.perl send-email: futureproof split_addrs() sub 2008-12-21 01:57:59 -08:00
git-sh-setup.sh git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir 2008-12-21 01:10:48 -08:00
git-stash.sh Revert "git-stash: use git rev-parse -q" 2008-12-07 17:30:35 -08:00
git-submodule.sh submodule: use git rev-parse -q 2008-12-03 14:27:18 -08:00
git-svn.perl Get rid of the last remnants of GIT_CONFIG_LOCAL 2008-12-14 16:43:39 -08:00
git-web--browse.sh
git.c git: s/run_command/run_builtin/ 2009-01-28 13:16:30 -08:00
git.spec.in Include git-gui--askpass in git-gui RPM package 2008-12-01 00:54:16 -08:00
graph.c
graph.h
grep.c
grep.h
hash-object.c
hash.c
hash.h
help.c
help.h
http-push.c http-push: when making directories, have a trailing slash in the path name 2009-01-17 18:19:46 -08:00
http-walker.c
http.c Merge branch 'maint' 2008-12-07 15:13:02 -08:00
http.h
ident.c Add backslash to list of 'crud' characters in real name 2008-12-02 15:29:13 -08:00
imap-send.c
index-pack.c Merge branch 'np/pack-safer' 2008-11-12 22:26:35 -08:00
levenshtein.c Document levenshtein.c 2008-11-23 19:23:34 -08:00
levenshtein.h
list-objects.c
list-objects.h
ll-merge.c merge-recursive: use strbuf_expand() instead of interpolate() 2008-11-23 19:55:52 -08:00
ll-merge.h
lockfile.c Make sure lockfiles are unlocked when dying on SIGPIPE 2008-12-21 01:56:20 -08:00
log-tree.c Fix machine-parseability of 'git log --source' 2008-11-16 00:24:41 -08:00
log-tree.h
mailmap.c
mailmap.h
match-trees.c
merge-file.c
merge-index.c
merge-recursive.c Merge branch 'js/maint-merge-recursive-r-d-conflict' into maint 2009-01-13 01:15:19 -08:00
merge-recursive.h
merge-tree.c
mktag.c
mktree.c
name-hash.c
object.c
object.h
pack-check.c
pack-redundant.c
pack-refs.c
pack-refs.h
pack-revindex.c
pack-revindex.h
pack-write.c
pack.h
pager.c Merge branch 'maint' 2008-12-15 23:06:13 -08:00
parse-options.c Teach/Fix pull/fetch -q/-v options 2008-11-14 17:18:32 -08:00
parse-options.h Teach/Fix pull/fetch -q/-v options 2008-11-14 17:18:32 -08:00
patch-delta.c
patch-id.c
patch-ids.c
patch-ids.h
path.c
pkt-line.c
pkt-line.h
preload-index.c Makefile: introduce NO_PTHREADS 2008-12-02 15:29:12 -08:00
pretty.c shortlog: handle multi-line subjects like log --pretty=oneline et. al. do 2009-01-06 22:06:07 -08:00
progress.c
progress.h
quote.c
quote.h
reachable.c
reachable.h
read-cache.c Make 'ce_compare_link()' use the new 'strbuf_readlink()' 2008-12-17 13:36:34 -08:00
reflog-walk.c
reflog-walk.h
refs.c
refs.h
remote.c Merge branch 'mk/maint-cg-push' 2008-11-12 22:26:24 -08:00
remote.h
rerere.c Make some of fwrite/fclose/write/close failures visible 2008-12-04 18:05:41 -08:00
rerere.h
revision.c Merge branch 'maint' 2008-11-14 22:12:38 -08:00
revision.h
run-command.c run_command(): handle missing command errors more gracefully 2009-01-28 14:08:57 -08:00
run-command.h
send-pack.h
server-info.c
setup.c Always show which directory is not a git repository 2008-12-21 18:46:41 -08:00
sha1-lookup.c
sha1-lookup.h
sha1_file.c Make 'index_path()' use 'strbuf_readlink()' 2008-12-17 13:36:34 -08:00
sha1_name.c Merge branch 'maint-1.6.0' into maint 2009-01-27 15:23:46 -08:00
shallow.c
shell.c
shortlog.h
show-index.c
sideband.c
sideband.h
strbuf.c Add generic 'strbuf_readlink()' helper function 2008-12-17 13:36:30 -08:00
strbuf.h Add generic 'strbuf_readlink()' helper function 2008-12-17 13:36:30 -08:00
string-list.c
string-list.h
symlinks.c
tag.c
tag.h
tar.h
test-chmtime.c
test-date.c
test-delta.c
test-genrandom.c
test-match-trees.c
test-parse-options.c
test-path-utils.c test-path-utils: Fix off by one, found by valgrind 2009-01-27 15:16:41 -08:00
test-sha1.c
test-sha1.sh
thread-utils.c
thread-utils.h
trace.c
transport.c
transport.h
tree-diff.c
tree-walk.c
tree-walk.h
tree.c
tree.h
unpack-file.c
unpack-trees.c Merge branch 'cb/maint-unpack-trees-absense' into maint 2009-01-23 19:06:38 -08:00
unpack-trees.h
update-server-info.c
upload-pack.c
usage.c
userdiff.c
userdiff.h
utf8.c
utf8.h
var.c
walker.c
walker.h
wrapper.c
write_or_die.c
ws.c
wt-status.c reorder ALLOW_TEXTCONV option setting 2008-12-07 19:59:25 -08:00
wt-status.h
xdiff-interface.c xdiff-interface.c: remove 10 duplicated lines 2008-11-26 10:47:41 -08:00
xdiff-interface.h

README

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/gittutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.