Code

git.git
14 years agot/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script
Brandon Casey [Mon, 21 Jun 2010 17:37:15 +0000 (12:37 -0500)]
t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script

The fake "less" script was already created in a previous test titled
'setup: fake "less"', so it is redundant.  Additionally, it is broken since
the redirection of 'cat' is to a file named 'less', but the chmod operates
on the file named by the $less variable which may not contain the value
'less'.

So, just remove this code, and rely on the creation of the fake "less"
script performed earlier within the test script.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t7811-grep-open.sh: ensure fake "less" is made executable
Brandon Casey [Mon, 21 Jun 2010 17:37:14 +0000 (12:37 -0500)]
t/t7811-grep-open.sh: ensure fake "less" is made executable

The fake "less" script was not being made executable.  This can cause the
tests that follow to fail.  This failure is not apparent on platforms which
have DEFAULT_PAGER set to the string "less", since lib-pager.sh will have
set the $less variable to "less" and the SIMPLEPAGER prerequisite will have
been set, and so the "less" script will have already been created properly
and made executable in test 2 'git grep -O'.  On platforms which set
DEFAULT_PAGER to something like "more", no such script will have been
previously created, and tests 7 and 8 will fail.

So, add a call to chmod to make the fake "less" script executable.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
Brandon Casey [Mon, 21 Jun 2010 17:37:13 +0000 (12:37 -0500)]
t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression

Regular expressions matched by 'expr' have an implicit '^' at the beginning
of them and so are anchored to the beginning of the string.  Using the '^'
character to mean "match at the beginning", is redundant and could produce
the wrong result if 'expr' implementations interpret the '^' as a literal
'^'.  Additionally, GNU expr 5.97 complains like this:

   expr: warning: unportable BRE: `^[a-z][a-z]*$': using `^' as the first character of the basic regular expression is not portable; it is being ignored

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogrep -O: allow optional argument specifying the pager (or editor)
Johannes Schindelin [Sat, 12 Jun 2010 16:39:46 +0000 (11:39 -0500)]
grep -O: allow optional argument specifying the pager (or editor)

Suppose you want to edit all files that contain a specific search term.
Of course, you can do something totally trivial such as

git grep -z -e <term> | xargs -0r vi +/<term>

but maybe you are happy that the same will be achieved by

git grep -Ovi <term>

now.

[jn: rebased and added tests]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogrep: Add the option '--open-files-in-pager'
Johannes Schindelin [Sat, 12 Jun 2010 16:36:51 +0000 (11:36 -0500)]
grep: Add the option '--open-files-in-pager'

This adds an option to open the matching files in the pager, and if the
pager happens to be "less" (or "vi") and there is only one grep pattern,
it also jumps to the first match right away.

The short option was chose as '-O' to avoid clashes with GNU grep's
options (as suggested by Junio).

So, 'git grep -O abc' is a short form for 'less +/abc $(grep -l abc)'
except that it works also with spaces in file names, and it does not
start the pager if there was no matching file.

[jn: rebased and added tests; with error handling fix from Junio
squashed in]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUnify code paths of threaded greps
Johannes Schindelin [Sat, 12 Jun 2010 16:32:11 +0000 (11:32 -0500)]
Unify code paths of threaded greps

There were three awfully similar code paths ending the threaded grep. It
is better to avoid duplicated code, though.

This change might very well prevent a race, where the grep patterns were
free()d before waiting that all threads finished.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogrep: refactor grep_objects loop into its own function
Jonathan Nieder [Sat, 12 Jun 2010 16:31:18 +0000 (11:31 -0500)]
grep: refactor grep_objects loop into its own function

Simplify cmd_grep by splitting off the loop that finds matches in a
list of trees.  So now the main part of cmd_grep looks like:

if (!use_index) {
int hit = grep_directory(&opt, paths);
if (use_threads)
hit |= wait_all();
return !hit;
}
if (!list.nr) {
if (!cached)
setup_work_tree();
int hit = grep_cache(&opt, paths, cached);
if (use_threads)
hit |= wait_all;
return !hit;
}
hit = grep_objects(&opt, path, &list);
if (use_threads)
hit |= wait_all();
return !hit;

and is ripe for further refactoring.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit svn: fix empty directory creation
Michael J. Kiwala [Tue, 1 Jun 2010 21:24:57 +0000 (16:24 -0500)]
git svn: fix empty directory creation

Avoid attempts to stat() the contents of '', which could happen
when the root directory is empty.  Additionally, remove the
unnecessary '_' stat optimization since it was confusing and
possibly throwing off the non-existent case.

[ew: fixed indentation, rewrote commit message]

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Michael J. Kiwala <mkiwala@genome.wustl.edu>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 2 Jun 2010 17:17:26 +0000 (10:17 -0700)]
Merge branch 'maint'

* maint:
  git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
  Documentation: A...B shortcut for checkout and rebase
  Documentation/pretty-{formats,options}: better reference for "format:<string>"

14 years agogit-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX
Gary V. Vaughan [Wed, 2 Jun 2010 01:55:36 +0000 (20:55 -0500)]
git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIX

IRIX 6.5.26m does not define the 'sgi' macro, but it does define an '__sgi'
macro.  Since later IRIX versions (6.5.29m) define both macros, and since
an underscore prefixed macro is preferred anyway, use '__sgi' to detect
compilation on SGI IRIX.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: A...B shortcut for checkout and rebase
Michael J Gruber [Tue, 1 Jun 2010 15:16:42 +0000 (17:16 +0200)]
Documentation: A...B shortcut for checkout and rebase

Describe the A...B shortcuts for checkout and rebase [-i] which were
introduced in these commits:

619a64e ("checkout A...B" switches to the merge base between A and B, 2009-10-18)
61dfa1b ("rebase --onto A...B" replays history on the merge base between A and B, 2009-11-20)
230a456 (rebase -i: teach --onto A...B syntax, 2010-01-07)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/pretty-{formats,options}: better reference for "format:<string>"
Nazri Ramliy [Tue, 1 Jun 2010 17:54:46 +0000 (01:54 +0800)]
Documentation/pretty-{formats,options}: better reference for "format:<string>"

In "git help log" (and friends) it's not easy to find the possible
placeholder for <string> for the "--pretty=format:<string>" option
to git log.

This patch makes the placeholder easier to find by adding a reference
to the "PRETTY FORMATS" section and repeating the "format:<string>"
phrase.

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 1 Jun 2010 01:14:23 +0000 (18:14 -0700)]
Merge branch 'maint'

* maint:
  Documentation/SubmittingPatches: Fix typo in GMail section
  Documentation/config: describe status.submodulesummary

14 years agoMerge branch 'maint-1.7.0' into maint
Junio C Hamano [Tue, 1 Jun 2010 01:14:17 +0000 (18:14 -0700)]
Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
  Documentation/config: describe status.submodulesummary

14 years agoDocumentation/SubmittingPatches: Fix typo in GMail section
Tim Henigan [Wed, 26 May 2010 12:36:10 +0000 (08:36 -0400)]
Documentation/SubmittingPatches: Fix typo in GMail section

Commit e498257d introduced a typo while improving the GMail section
of SubmittingPatches.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/config: describe status.submodulesummary
Michael J Gruber [Thu, 20 May 2010 15:55:42 +0000 (17:55 +0200)]
Documentation/config: describe status.submodulesummary

ac8d5af (builtin-status: submodule summary support, 2008-04-12)
intoduced this variable and described it in git-status[1].

Include this description in git-config[1], as well.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Fri, 28 May 2010 23:59:42 +0000 (16:59 -0700)]
Merge branch 'maint'

* maint:
  Makefile: reenable install with NO_CURL
  completion: --set-upstream option for git-branch
  get_cwd_relative(): do not misinterpret suffix as subdirectory

14 years agoMerge branch 'maint-1.7.0' into maint
Junio C Hamano [Fri, 28 May 2010 23:59:36 +0000 (16:59 -0700)]
Merge branch 'maint-1.7.0' into maint

* maint-1.7.0:
  Makefile: reenable install with NO_CURL

14 years agoMakefile: reenable install with NO_CURL
Michael J Gruber [Wed, 26 May 2010 14:24:34 +0000 (16:24 +0200)]
Makefile: reenable install with NO_CURL

Setting NO_CURL leaves some variables like REMOTE_CURL_ALIASES
empty, which creates no fun when for-looping over
$(REMOTE_CURL_ALIASES) unconditionally. Make it conditional.

Reported-by: Paul Walker <PWalker752@aol.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocompletion: --set-upstream option for git-branch
Michael J Gruber [Wed, 26 May 2010 08:46:41 +0000 (10:46 +0200)]
completion: --set-upstream option for git-branch

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoget_cwd_relative(): do not misinterpret suffix as subdirectory
Clemens Buchacher [Sat, 22 May 2010 11:13:05 +0000 (13:13 +0200)]
get_cwd_relative(): do not misinterpret suffix as subdirectory

If the current working directory is the same as the work tree path
plus a suffix, e.g. 'work' and 'work-xyz', then the suffix '-xyz'
would be interpreted as a subdirectory of 'work'.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 25 May 2010 20:13:43 +0000 (13:13 -0700)]
Merge branch 'maint'

* maint:
  Documentation/SubmittingPatches: clarify GMail section and SMTP
  show-branch: use DEFAULT_ABBREV instead of 7
  t7502-commit: fix spelling
  test get_git_work_tree() return value for NULL

14 years agoDocumentation/SubmittingPatches: clarify GMail section and SMTP
Michael J Gruber [Tue, 25 May 2010 08:30:13 +0000 (10:30 +0200)]
Documentation/SubmittingPatches: clarify GMail section and SMTP

We keep getting mangled submissions from GMail's web interface. Try to
be more proactive in SubmittingPatches by

- pointing to MUA specific instructions early on,
- structuring the GMail section more clearly,
- putting send-email/SMTP before imap-send/IMAP.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoshow-branch: use DEFAULT_ABBREV instead of 7
Tay Ray Chuan [Mon, 24 May 2010 08:50:44 +0000 (16:50 +0800)]
show-branch: use DEFAULT_ABBREV instead of 7

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7502-commit: fix spelling
Tay Ray Chuan [Mon, 24 May 2010 08:51:17 +0000 (16:51 +0800)]
t7502-commit: fix spelling

s/subdirecotry/subdirectory/

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotest get_git_work_tree() return value for NULL
Clemens Buchacher [Sat, 22 May 2010 12:21:27 +0000 (14:21 +0200)]
test get_git_work_tree() return value for NULL

If we are in a git directory, get_git_work_tree() can return NULL.
While trying to determine whether or not the given paths are outside
the work tree, the following command would read from it anyways and
trigger a segmentation fault.

 git diff / /

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'by/blame-doc-m-c'
Junio C Hamano [Fri, 21 May 2010 11:02:24 +0000 (04:02 -0700)]
Merge branch 'by/blame-doc-m-c'

* by/blame-doc-m-c:
  blame-options.txt: Add default value for `-M/-C` options.

14 years agoMerge branch 'by/log-follow'
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'by/log-follow'

* by/log-follow:
  tests: rename duplicate t4205
  Make git log --follow find copies among unmodified files.
  Make diffcore_std only can run once before a diff_flush
  Add a macro DIFF_QUEUE_CLEAR.

14 years agoMerge branch 'mg/advice-statushints'
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'mg/advice-statushints'

* mg/advice-statushints:
  wt-status: take advice.statusHints seriously
  t7508: test advice.statusHints

Conflicts:
wt-status.c

14 years agoMerge branch 'cb/maint-stash-orphaned-file'
Junio C Hamano [Fri, 21 May 2010 11:02:23 +0000 (04:02 -0700)]
Merge branch 'cb/maint-stash-orphaned-file'

* cb/maint-stash-orphaned-file:
  stash tests: stash can lose data in a file removed from the index
  stash: Don't overwrite files that have gone from the index

14 years agoMerge branch 'jn/maint-bundle'
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'jn/maint-bundle'

* jn/maint-bundle:
  fix "bundle --stdin" segfault
  t5704 (bundle): add tests for bundle --stdin

14 years agoMerge branch 'pb/patch-id-plus'
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'pb/patch-id-plus'

* pb/patch-id-plus:
  patch-id: Add support for mbox format
  patch-id: extract parsing one diff out of generate_id_list

14 years agoMerge branch 'rr/doc-submitting'
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'rr/doc-submitting'

* rr/doc-submitting:
  SubmittingPatches: Add new section about what to base work on

14 years agoMerge branch 'st/remote-tags-no-tags'
Junio C Hamano [Fri, 21 May 2010 11:02:22 +0000 (04:02 -0700)]
Merge branch 'st/remote-tags-no-tags'

* st/remote-tags-no-tags:
  remote add: add a --[no-]tags option
  Honor "tagopt = --tags" configuration option

14 years agoMerge branch 'jn/fsck-ident'
Junio C Hamano [Fri, 21 May 2010 11:02:21 +0000 (04:02 -0700)]
Merge branch 'jn/fsck-ident'

* jn/fsck-ident:
  fsck: check ident lines in commit objects

14 years agoMerge branch 'jn/gitweb-caching-prep'
Junio C Hamano [Fri, 21 May 2010 11:02:21 +0000 (04:02 -0700)]
Merge branch 'jn/gitweb-caching-prep'

* jn/gitweb-caching-prep:
  gitweb: Move generating page title to separate subroutine
  gitweb: Add custom error handler using die_error
  gitweb: Use nonlocal jump instead of 'exit' in die_error
  gitweb: href(..., -path_info => 0|1)
  Export more test-related variables when running external tests

14 years agoMerge branch 'jn/gitweb-install'
Junio C Hamano [Fri, 21 May 2010 11:02:21 +0000 (04:02 -0700)]
Merge branch 'jn/gitweb-install'

* jn/gitweb-install:
  gitweb: Create install target for gitweb in Makefile
  gitweb: Improve installation instructions in gitweb/INSTALL

14 years agoMerge branch 'jn/gitweb-our-squelch'
Junio C Hamano [Fri, 21 May 2010 11:02:20 +0000 (04:02 -0700)]
Merge branch 'jn/gitweb-our-squelch'

* jn/gitweb-our-squelch:
  gitweb: Silence 'Variable VAR may be unavailable' warnings

14 years agoMerge branch 'jn/request-pull'
Junio C Hamano [Fri, 21 May 2010 11:02:20 +0000 (04:02 -0700)]
Merge branch 'jn/request-pull'

* jn/request-pull:
  tests: chmod +x t5150
  adapt request-pull tests for new pull request format
  t5150: protect backslash with backslash in shell
  request-pull: protect against OPTIONS_KEEPDASHDASH from environment
  tests for request-pull

14 years agoMerge branch 'jn/shortlog'
Junio C Hamano [Fri, 21 May 2010 11:02:20 +0000 (04:02 -0700)]
Merge branch 'jn/shortlog'

* jn/shortlog:
  pretty: Respect --abbrev option
  shortlog: Document and test --format option
  t4201 (shortlog): Test output format with multiple authors
  t4201 (shortlog): guard setup with test_expect_success
  Documentation/shortlog: scripted users should not rely on implicit HEAD

14 years agoMerge branch 'jn/t7006-fixup'
Junio C Hamano [Fri, 21 May 2010 11:02:20 +0000 (04:02 -0700)]
Merge branch 'jn/t7006-fixup'

* jn/t7006-fixup:
  t7006: guard cleanup with test_expect_success

14 years agoMerge branch 'js/maint-receive-pack-symref-alias'
Junio C Hamano [Fri, 21 May 2010 11:02:19 +0000 (04:02 -0700)]
Merge branch 'js/maint-receive-pack-symref-alias'

* js/maint-receive-pack-symref-alias:
  t5516-fetch-push.sh: style cleanup
  receive-pack: detect aliased updates which can occur with symrefs
  receive-pack: switch global variable 'commands' to a parameter

Conflicts:
t/t5516-fetch-push.sh

14 years agoMerge branch 'sp/maint-dumb-http-pack-reidx'
Junio C Hamano [Fri, 21 May 2010 11:02:19 +0000 (04:02 -0700)]
Merge branch 'sp/maint-dumb-http-pack-reidx'

* sp/maint-dumb-http-pack-reidx:
  http.c::new_http_pack_request: do away with the temp variable filename
  http-fetch: Use temporary files for pack-*.idx until verified
  http-fetch: Use index-pack rather than verify-pack to check packs
  Allow parse_pack_index on temporary files
  Extract verify_pack_index for reuse from verify_pack
  Introduce close_pack_index to permit replacement
  http.c: Remove unnecessary strdup of sha1_to_hex result
  http.c: Don't store destination name in request structures
  http.c: Drop useless != NULL test in finish_http_pack_request
  http.c: Tiny refactoring of finish_http_pack_request
  t5550-http-fetch: Use subshell for repository operations
  http.c: Remove bad free of static block

14 years agoMerge branch 'jn/submodule-basic-test'
Junio C Hamano [Fri, 21 May 2010 11:02:19 +0000 (04:02 -0700)]
Merge branch 'jn/submodule-basic-test'

* jn/submodule-basic-test:
  t7400: clarify submodule update tests
  t7400: clarify 'submodule add' tests
  t7400: split setup into multiple tests

14 years agoMerge branch 'np/index-pack-memsave'
Junio C Hamano [Fri, 21 May 2010 11:02:19 +0000 (04:02 -0700)]
Merge branch 'np/index-pack-memsave'

* np/index-pack-memsave:
  index-pack: smarter memory usage when appending objects
  index-pack: rationalize unpack_entry_data()
  index-pack: smarter memory usage when resolving deltas

14 years agoMerge branch 'jc/am-3-show-corrupted-patch'
Junio C Hamano [Fri, 21 May 2010 11:02:18 +0000 (04:02 -0700)]
Merge branch 'jc/am-3-show-corrupted-patch'

* jc/am-3-show-corrupted-patch:
  am -3: recover the diagnostic messages for corrupt patches

14 years agoMerge branch 'jc/maint-no-reflog-expire-unreach-for-head'
Junio C Hamano [Fri, 21 May 2010 11:02:18 +0000 (04:02 -0700)]
Merge branch 'jc/maint-no-reflog-expire-unreach-for-head'

* jc/maint-no-reflog-expire-unreach-for-head:
  reflog --expire-unreachable: special case entries in "HEAD" reflog
  more war on "sleep" in tests
  Document gc.<pattern>.reflogexpire variables

Conflicts:
Documentation/config.txt

14 years agoMerge branch 'cw/maint-exec-defpath'
Junio C Hamano [Fri, 21 May 2010 11:02:17 +0000 (04:02 -0700)]
Merge branch 'cw/maint-exec-defpath'

* cw/maint-exec-defpath:
  autoconf: Check if <paths.h> exists and set HAVE_PATHS_H
  exec_cmd.c: replace hard-coded path list with one from <paths.h>

14 years agoMerge branch 'tr/word-diff'
Junio C Hamano [Fri, 21 May 2010 11:02:17 +0000 (04:02 -0700)]
Merge branch 'tr/word-diff'

* tr/word-diff:
  diff: add --word-diff option that generalizes --color-words

Conflicts:
diff.c

14 years agoMerge branch 'sp/maint-describe-tiebreak-with-tagger-date'
Junio C Hamano [Fri, 21 May 2010 11:02:17 +0000 (04:02 -0700)]
Merge branch 'sp/maint-describe-tiebreak-with-tagger-date'

* sp/maint-describe-tiebreak-with-tagger-date:
  describe: Break annotated tag ties by tagger date
  tag.c: Parse tagger date (if present)
  tag.c: Refactor parse_tag_buffer to be saner to program
  tag.h: Remove unused signature field
  tag.c: Correct indentation

14 years agoMerge branch 'jc/status-show-ignored'
Junio C Hamano [Fri, 21 May 2010 11:02:16 +0000 (04:02 -0700)]
Merge branch 'jc/status-show-ignored'

* jc/status-show-ignored:
  wt-status: fix 'fprintf' compilation warning
  status: --ignored option shows ignored files
  wt-status: rename and restructure status-print-untracked
  wt-status: collect ignored files
  wt-status: plug memory leak while collecting untracked files
  wt-status: remove unused workdir_untracked member

14 years agoMerge branch 'np/malloc-threading'
Junio C Hamano [Fri, 21 May 2010 11:02:16 +0000 (04:02 -0700)]
Merge branch 'np/malloc-threading'

* np/malloc-threading:
  Thread-safe xmalloc and xrealloc needs a recursive mutex
  Make xmalloc and xrealloc thread-safe

14 years agoMerge branch 'sr/remote-helper-export'
Junio C Hamano [Fri, 21 May 2010 11:02:15 +0000 (04:02 -0700)]
Merge branch 'sr/remote-helper-export'

* sr/remote-helper-export:
  t5800: testgit helper requires Python support
  Makefile: Simplify handling of python scripts
  remote-helpers: add tests for testgit helper
  remote-helpers: add testgit helper
  remote-helpers: add support for an export command
  remote-helpers: allow requesing the path to the .git directory
  fast-import: always create marks_file directories
  clone: also configure url for bare clones
  clone: pass the remote name to remote_get

Conflicts:
Makefile

14 years agoMerge branch 'ld/discovery-limit-to-fs' (early part)
Junio C Hamano [Fri, 21 May 2010 11:02:15 +0000 (04:02 -0700)]
Merge branch 'ld/discovery-limit-to-fs' (early part)

* 'ld/discovery-limit-to-fs' (early part):
  Rename ONE_FILESYSTEM to DISCOVERY_ACROSS_FILESYSTEM
  GIT_ONE_FILESYSTEM: flip the default to stop at filesystem boundaries
  Add support for GIT_ONE_FILESYSTEM
  truncate cwd string before printing error message
  config.c: remove static keyword from git_env_bool()

14 years agoMerge branch 'ar/config-from-command-line'
Junio C Hamano [Fri, 21 May 2010 11:02:14 +0000 (04:02 -0700)]
Merge branch 'ar/config-from-command-line'

* ar/config-from-command-line:
  Complete prototype of git_config_from_parameters()
  Use strbufs instead of open-coded string manipulation
  Allow passing of configuration parameters in the command line

14 years agoMerge branch 'em/checkout-orphan'
Junio C Hamano [Fri, 21 May 2010 11:02:14 +0000 (04:02 -0700)]
Merge branch 'em/checkout-orphan'

* em/checkout-orphan:
  git checkout: create unparented branch by --orphan

14 years agoComplete prototype of git_config_from_parameters()
Thomas Rast [Fri, 21 May 2010 10:07:47 +0000 (12:07 +0200)]
Complete prototype of git_config_from_parameters()

Add the missing argument list.  (Its lack triggered a compiler warning
for me.)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Fri, 21 May 2010 10:13:07 +0000 (03:13 -0700)]
Merge branch 'maint'

* maint:
  Fix checkout of large files to network shares on Windows XP
  start_command: close cmd->err descriptor when fork/spawn fails
  Fix "Out of memory? mmap failed" for files larger than 4GB on Windows

14 years agoFix checkout of large files to network shares on Windows XP
René Scharfe [Thu, 20 May 2010 18:57:53 +0000 (20:57 +0200)]
Fix checkout of large files to network shares on Windows XP

Bigger writes to network drives on Windows XP fail.  Cap them at 31MB to
allow them to succeed.  Callers need to be prepared for write() calls
that do less work than requested anyway.

On local drives, write() calls are translated to WriteFile() calls with
a cap of 64KB on Windows XP and 256KB on Vista.  Thus a cap of 31MB won't
affect the number of WriteFile() calls which do the actual work.  There's
still room for some other version of Windows to use a chunk size of 1MB
without increasing the number of system calls.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostart_command: close cmd->err descriptor when fork/spawn fails
bert Dvornik [Thu, 20 May 2010 18:57:52 +0000 (20:57 +0200)]
start_command: close cmd->err descriptor when fork/spawn fails

Fix the problem where the cmd->err passed into start_command wasn't
being properly closed when certain types of errors occurr.  (Compare
the affected code with the clean shutdown code later in the function.)

On Windows, this problem would be triggered if mingw_spawnvpe()
failed, which would happen if the command to be executed was malformed
(e.g. a text file that didn't start with a #! line).  If cmd->err was
a pipe, the failure to close it could result in a hang while the other
side was waiting (forever) for either input or pipe close, e.g. while
trying to shove the output into the side band.  On msysGit, this
problem was causing a hang in t5516-fetch-push.

[J6t: With a slight adjustment of the test case, the hang is also
observed on Linux.]

Signed-off-by: bert Dvornik <dvornik+git@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix "Out of memory? mmap failed" for files larger than 4GB on Windows
Ian McLean [Thu, 20 May 2010 18:57:51 +0000 (20:57 +0200)]
Fix "Out of memory? mmap failed" for files larger than 4GB on Windows

The git_mmap implementation was broken for file sizes that wouldn't fit
into a size_t (32 bits).  This was caused by intermediate variables that
were only 32 bits wide when they should be 64 bits.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Thu, 20 May 2010 04:28:51 +0000 (21:28 -0700)]
Merge branch 'maint'

* maint:
  post-receive-email: document command-line mode

14 years agopost-receive-email: document command-line mode
Jonathan Nieder [Wed, 19 May 2010 19:01:47 +0000 (14:01 -0500)]
post-receive-email: document command-line mode

According to the default hooks/post-receive file, the hook is called
with three arguments on stdin:

  <oldrev> <newrev> <refname>

In command-line mode, the arguments come in a different order, because
the email hook instead calls:

  generate_email $2 $3 $1

Add a comment to explain why, based on comments from the mailing list
and the commit message to v1.5.1~9.  Thanks to Andy for the
explanation.

Requested-by: martin f. krafft <madduck@debian.org>
Cc: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 19 May 2010 05:39:56 +0000 (22:39 -0700)]
Merge branch 'maint'

* maint:
  Documentation/gitdiffcore: fix order in pickaxe description
  Documentation: fix minor inconsistency
  Documentation: rebase -i ignores options passed to "git am"
  hash_object: correction for zero length file

14 years agoDocumentation/gitdiffcore: fix order in pickaxe description
Michael J Gruber [Tue, 18 May 2010 10:49:33 +0000 (12:49 +0200)]
Documentation/gitdiffcore: fix order in pickaxe description

Reverse the order of "origin" and "result" so that the sentence
really describes an addition rather than a removal.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: fix minor inconsistency
Michael J Gruber [Thu, 13 May 2010 12:51:38 +0000 (14:51 +0200)]
Documentation: fix minor inconsistency

While we don't always write out commands in full (`git command`) we
should do it consistently in adjacent paragraphs.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: rebase -i ignores options passed to "git am"
Markus Heidelberg [Thu, 13 May 2010 12:47:53 +0000 (14:47 +0200)]
Documentation: rebase -i ignores options passed to "git am"

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff-options: make --patch a synonym for -p
Will Palmer [Thu, 13 May 2010 08:59:00 +0000 (09:59 +0100)]
diff-options: make --patch a synonym for -p

Here we simply make --patch a synonym for -p, whose mnemonic was "patch"
all along.

Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofor-each-ref: Field with abbreviated objectname
Michael J Gruber [Thu, 13 May 2010 12:31:46 +0000 (14:31 +0200)]
for-each-ref: Field with abbreviated objectname

Introduce a :short modifier to objectname which outputs the abbreviated
object name.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohash_object: correction for zero length file
Dmitry Potapov [Mon, 10 May 2010 21:38:17 +0000 (01:38 +0400)]
hash_object: correction for zero length file

The check whether size is zero was done after if size <= SMALL_FILE_SIZE,
as result, zero size case was never triggered. Instead zero length file
was treated as any other small file. This did not caused any problem, but
if we have a special case for size equal to zero, it is better to make it
work and avoid redundant malloc().

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Use @diff_opts while using format-patch
Pavan Kumar Sunkara [Mon, 10 May 2010 16:41:35 +0000 (18:41 +0200)]
gitweb: Use @diff_opts while using format-patch

Make git-format-patch (used by 'patch' and 'patches' views) use the
same rename detection options that git-diff and git-diff-tree (used
by 'commitdiff', 'blobdiff', etc.) use.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 12 May 2010 06:04:47 +0000 (23:04 -0700)]
Merge branch 'maint'

* maint:
  GIT-VERSION-GEN: restrict tags used

14 years agoGIT-VERSION-GEN: restrict tags used
Tay Ray Chuan [Wed, 12 May 2010 03:29:20 +0000 (11:29 +0800)]
GIT-VERSION-GEN: restrict tags used

Restrict the tags used to generate the version string to those that
begin with "v", since git's tags for git-core (ie. excluding git-gui)
are all of the form "vX.Y...".

This is to avoid using private tags by the user in a clone of the git
code repository, which may break certain machinery (eg. Makefile, gitk).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 11 May 2010 01:34:03 +0000 (18:34 -0700)]
Merge branch 'maint'

* maint:
  handle "git --bare init <dir>" properly

14 years agotests: chmod +x t5150
Jeff King [Mon, 10 May 2010 09:51:39 +0000 (05:51 -0400)]
tests: chmod +x t5150

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: rename duplicate t4205
Jeff King [Mon, 10 May 2010 09:47:39 +0000 (05:47 -0400)]
tests: rename duplicate t4205

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohandle "git --bare init <dir>" properly
Jeff King [Mon, 10 May 2010 09:42:06 +0000 (05:42 -0400)]
handle "git --bare init <dir>" properly

If we know we are creating a bare repository, we use setenv
to set the GIT_DIR directory to the current directory
(either where we already were, or one we created and chdir'd
into with "git init --bare <dir>").

However, with "git --bare init <dir>" (note the --bare as a
git wrapper option), the setup code actually sets GIT_DIR
for us, but it uses the wrong, original cwd when a directory
is given. Because our setenv does not use the overwrite
flag, it is ignored.

We need to set the overwrite flag, but only when we are
given a directory on the command line. That still allows:

  GIT_DIR=foo.git git init --bare

to work. The behavior is changed for:

  GIT_DIR=foo.git git init --bare bar.git

which used to create the repository in foo.git, but now will
use bar.git. This is more sane, as command line options
should generally override the environment.

Noticed by Oliver Hoffmann.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-svn: mangle refnames forbidden in git
Torsten Schmutzler [Thu, 6 May 2010 20:20:43 +0000 (22:20 +0200)]
git-svn: mangle refnames forbidden in git

git-check-ref-format(1) describes names which
cannot be used as refnames for git.  Some are
legal branchnames in subversion however.
Mangle the not yet handled cases.

Signed-off-by: Torsten Schmutzler <git-ts@theblacksun.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agogit-svn: Remove unused use of File::Temp
Ævar Arnfjörð Bjarmason [Sat, 8 May 2010 16:40:41 +0000 (16:40 +0000)]
git-svn: Remove unused use of File::Temp

The use line was added in ffe256f9. File::Temp calls were later moved
to Git.pm in 0b19138b, but that commit neglected to remove the
now-redundant import.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agogit-svn documentation: minor grammar fix
Ævar Arnfjörð Bjarmason [Fri, 7 May 2010 19:50:03 +0000 (19:50 +0000)]
git-svn documentation: minor grammar fix

Use the definite article when talking about a configuration property.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agogit svn: avoid uninitialized var in 'reset'
Jonathan Nieder [Tue, 4 May 2010 23:36:47 +0000 (16:36 -0700)]
git svn: avoid uninitialized var in 'reset'

When "git svn reset" is called with an invalid revision, we
bail out and show the user a proper error message instead
of giving them a cryptic one related to git-svn internals.

ref: http://bugs.debian.org/578908
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reported-by: Jens Seidel <jensseidel@users.sf.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agoStart 1.7.2 cycle
Junio C Hamano [Sun, 9 May 2010 05:58:36 +0000 (22:58 -0700)]
Start 1.7.2 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'bg/apply-blank-trailing-context'
Junio C Hamano [Sun, 9 May 2010 05:37:41 +0000 (22:37 -0700)]
Merge branch 'bg/apply-blank-trailing-context'

* bg/apply-blank-trailing-context:
  apply: Allow blank *trailing* context lines to match beyond EOF

14 years agoMerge branch 'bg/send-email-smtpdomain'
Junio C Hamano [Sun, 9 May 2010 05:37:34 +0000 (22:37 -0700)]
Merge branch 'bg/send-email-smtpdomain'

* bg/send-email-smtpdomain:
  send-email: Cleanup smtp-domain and add config
  Document send-email --smtp-domain
  send-email: Don't use FQDNs without a '.'
  send-email: Cleanup { style

14 years agoMerge branch 'rc/ls-remote-default'
Junio C Hamano [Sun, 9 May 2010 05:37:28 +0000 (22:37 -0700)]
Merge branch 'rc/ls-remote-default'

* rc/ls-remote-default:
  ls-remote: fall-back to default remotes when no remote specified

14 years agoMerge branch 'rc/maint-curl-helper'
Junio C Hamano [Sun, 9 May 2010 05:37:24 +0000 (22:37 -0700)]
Merge branch 'rc/maint-curl-helper'

* rc/maint-curl-helper:
  remote-curl: ensure that URLs have a trailing slash
  http: make end_url_with_slash() public
  t5541-http-push: add test for URLs with trailing slash

Conflicts:
remote-curl.c

14 years agoMerge branch 'hg/maint-attr-fix'
Junio C Hamano [Sun, 9 May 2010 05:37:05 +0000 (22:37 -0700)]
Merge branch 'hg/maint-attr-fix'

* hg/maint-attr-fix:
  attr: Expand macros immediately when encountered.
  attr: Allow multiple changes to an attribute on the same line.
  attr: Fixed debug output for macro expansion.

14 years agoMerge branch 'eb/unpretty-b-format'
Junio C Hamano [Sun, 9 May 2010 05:36:40 +0000 (22:36 -0700)]
Merge branch 'eb/unpretty-b-format'

* eb/unpretty-b-format:
  Add `%B' in format strings for raw commit body in `git log' and friends

14 years agoMerge branch 'ab/commit-empty-message'
Junio C Hamano [Sun, 9 May 2010 05:36:31 +0000 (22:36 -0700)]
Merge branch 'ab/commit-empty-message'

* ab/commit-empty-message:
  Add option to git-commit to allow empty log messages

14 years agoMerge branch 'jc/test-sleepless'
Junio C Hamano [Sun, 9 May 2010 05:36:23 +0000 (22:36 -0700)]
Merge branch 'jc/test-sleepless'

* jc/test-sleepless:
  war on "sleep" in tests

14 years agoMerge branch 'jc/maint-reflog-expire-unreachable'
Junio C Hamano [Sun, 9 May 2010 05:36:16 +0000 (22:36 -0700)]
Merge branch 'jc/maint-reflog-expire-unreachable'

* jc/maint-reflog-expire-unreachable:
  reflog --expire-unreachable: avoid merge-base computation

14 years agoMerge branch 'sd/log-decorate'
Junio C Hamano [Sun, 9 May 2010 05:36:14 +0000 (22:36 -0700)]
Merge branch 'sd/log-decorate'

* sd/log-decorate:
  log.decorate: only ignore it under "log --pretty=raw"
  script with rev-list instead of log
  log --pretty/--oneline: ignore log.decorate
  log.decorate: usability fixes
  Add `log.decorate' configuration variable.
  git_config_maybe_bool()

Conflicts:
builtin/log.c

14 years agoMerge branch 'mh/status-optionally-refresh'
Junio C Hamano [Sun, 9 May 2010 05:35:39 +0000 (22:35 -0700)]
Merge branch 'mh/status-optionally-refresh'

* mh/status-optionally-refresh:
  t7508: add a test for "git status" in a read-only repository
  git status: refresh the index if possible
  t7508: add test for "git status" refreshing the index

14 years agoMerge branch 'cw/ws-indent-with-tab'
Junio C Hamano [Sun, 9 May 2010 05:35:35 +0000 (22:35 -0700)]
Merge branch 'cw/ws-indent-with-tab'

* cw/ws-indent-with-tab:
  whitespace: tests for git-apply --whitespace=fix with tab-in-indent
  whitespace: add tab-in-indent support for --whitespace=fix
  whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst
  whitespace: tests for git-diff --check with tab-in-indent error class
  whitespace: add tab-in-indent error class
  whitespace: we cannot "catch all errors known to git" anymore

14 years agoMerge branch 'cc/revert-strategy'
Junio C Hamano [Sun, 9 May 2010 05:34:47 +0000 (22:34 -0700)]
Merge branch 'cc/revert-strategy'

* cc/revert-strategy:
  revert: add "--strategy" option to choose merge strategy
  merge: make function try_merge_command non static
  merge: refactor code that calls "git merge-STRATEGY"
  revert: refactor merge recursive code into its own function
  revert: use strbuf to refactor the code that writes the merge message

Conflicts:
builtin/revert.c

14 years agoMerge branch 'sc/http-late-auth'
Junio C Hamano [Sun, 9 May 2010 05:33:16 +0000 (22:33 -0700)]
Merge branch 'sc/http-late-auth'

* sc/http-late-auth:
  Prompt for a username when an HTTP request 401s

14 years agoMerge branch 'jk/cached-textconv'
Junio C Hamano [Sun, 9 May 2010 05:33:08 +0000 (22:33 -0700)]
Merge branch 'jk/cached-textconv'

* jk/cached-textconv:
  diff: avoid useless filespec population
  diff: cache textconv output
  textconv: refactor calls to run_textconv
  introduce notes-cache interface
  make commit_tree a library function

14 years agoMerge branch 'pc/remove-warn'
Junio C Hamano [Sun, 9 May 2010 05:32:59 +0000 (22:32 -0700)]
Merge branch 'pc/remove-warn'

* pc/remove-warn:
  Remove a redundant errno test in a usage of remove_path
  Introduce remove_or_warn function
  Implement the rmdir_or_warn function
  Generalise the unlink_or_warn function

14 years agocherry-pick: do not dump core when iconv fails
Jonathan Nieder [Sat, 8 May 2010 23:17:29 +0000 (18:17 -0500)]
cherry-pick: do not dump core when iconv fails

When cherry-picking, usually the new and old commit encodings are both
UTF-8.  Most old iconv implementations do not support this trivial
conversion, so on old platforms, out->message remains NULL, and later
attempts to read it segfault.

Fix this by noticing the input and output encodings match and skipping
the iconv step, like the other reencode_string() call sites already do.
Also stop segfaulting on other iconv failures: if iconv fails for some
other reason, the best we can do is to pass the old message through.

This fixes a regression introduced in v1.7.1-rc0~15^2~2 (revert:
clarify label on conflict hunks, 2010-03-20).

Reported-by: Andreas Krey <a.krey@gmx.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Fix 'clean' target to remove all gitweb build files
Ramsay Jones [Sat, 8 May 2010 17:36:15 +0000 (18:36 +0100)]
Makefile: Fix 'clean' target to remove all gitweb build files

In particular the gitweb/GITWEB-BUILD-OPTIONS file was not being
removed by the main Makefile. However, the gitweb/Makefile has a
'clean' target that correctly removes all the build products.
In order to fix the problem, rather than duplicate the clean-up
instructions, we change the main Makefile so that it delegates
the clean-up actions to the gitweb Makefile.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>