git
13 years agoMerge branch 'jh/clean-exclude' into next
Junio C Hamano [Fri, 13 Aug 2010 01:37:37 +0000 (18:37 -0700)] 
Merge branch 'jh/clean-exclude' into next

* jh/clean-exclude:
  Add test for git clean -e.
  Add -e/--exclude to git-clean.

13 years agoMerge branch 'jh/use-test-must-fail' into next
Junio C Hamano [Fri, 13 Aug 2010 01:37:20 +0000 (18:37 -0700)] 
Merge branch 'jh/use-test-must-fail' into next

* jh/use-test-must-fail:
  Convert "! git" to "test_must_fail git"

13 years agoMerge branch 'jn/fix-abbrev' into next
Junio C Hamano [Fri, 13 Aug 2010 01:36:52 +0000 (18:36 -0700)] 
Merge branch 'jn/fix-abbrev' into next

* jn/fix-abbrev:
  examples/commit: use --abbrev for commit summary
  checkout, commit: remove confusing assignments to rev.abbrev
  archive: abbreviate substituted commit ids again

13 years agoMerge branch 'jn/rebase-rename-am' into next
Junio C Hamano [Fri, 13 Aug 2010 01:36:39 +0000 (18:36 -0700)] 
Merge branch 'jn/rebase-rename-am' into next

* jn/rebase-rename-am:
  rebase: protect against diff.renames configuration
  t3400 (rebase): whitespace cleanup
  Teach "apply --index-info" to handle rename patches
  t4150 (am): futureproof against failing tests
  t4150 (am): style fix

13 years agoMerge branch 'ml/rebase-x-strategy' into next
Junio C Hamano [Fri, 13 Aug 2010 01:36:28 +0000 (18:36 -0700)] 
Merge branch 'ml/rebase-x-strategy' into next

* ml/rebase-x-strategy:
  rebase: support -X to pass through strategy options

13 years agoMerge branch 'mm/shortopt-detached' into next
Junio C Hamano [Fri, 13 Aug 2010 01:36:21 +0000 (18:36 -0700)] 
Merge branch 'mm/shortopt-detached' into next

* mm/shortopt-detached:
  log: parse separate option for --glob
  log: parse separate options like git log --grep foo
  diff: parse separate options --stat-width n, --stat-name-width n
  diff: split off a function for --stat-* option parsing
  diff: parse separate options like -S foo

Conflicts:
revision.c

13 years agoMerge branch 'nd/fix-sparse-checkout' into next
Junio C Hamano [Fri, 13 Aug 2010 01:35:19 +0000 (18:35 -0700)] 
Merge branch 'nd/fix-sparse-checkout' into next

* nd/fix-sparse-checkout:
  unpack-trees: mark new entries skip-worktree appropriately
  unpack-trees: do not check for conflict entries too early
  unpack-trees: let read-tree -u remove index entries outside sparse area
  unpack-trees: only clear CE_UPDATE|CE_REMOVE when skip-worktree is always set
  t1011 (sparse checkout): style nitpicks

13 years agoMerge branch 'vs/doc-spell' into next
Junio C Hamano [Fri, 13 Aug 2010 01:34:24 +0000 (18:34 -0700)] 
Merge branch 'vs/doc-spell' into next

* vs/doc-spell:
  Documentation: spelling fixes

13 years agoMerge branch 'ab/report-corrupt-object-with-type' into next
Junio C Hamano [Fri, 13 Aug 2010 01:34:18 +0000 (18:34 -0700)] 
Merge branch 'ab/report-corrupt-object-with-type' into next

* ab/report-corrupt-object-with-type:
  sha1_file: Show the the type and path to corrupt objects

13 years agoMerge branch 'kf/post-receive-sample-hook' into next
Junio C Hamano [Fri, 13 Aug 2010 01:34:05 +0000 (18:34 -0700)] 
Merge branch 'kf/post-receive-sample-hook' into next

* kf/post-receive-sample-hook:
  post-receive-email: optional message line count limit

13 years agoMerge branch 'master' into next
Junio C Hamano [Fri, 13 Aug 2010 01:33:37 +0000 (18:33 -0700)] 
Merge branch 'master' into next

* master:
  push: mention "git pull" in error message for non-fast forwards
  Standardize do { ... } while (0) style
  t/t7003: replace \t with literal tab in sed expression
  index-pack: Don't follow replace refs.

13 years agoMerge branch 'jc/sha1-name-find-fix'
Junio C Hamano [Fri, 13 Aug 2010 01:32:49 +0000 (18:32 -0700)] 
Merge branch 'jc/sha1-name-find-fix'

* jc/sha1-name-find-fix:
  sha1_name.c: fix parsing of ":/token" syntax

Conflicts:
sha1_name.c

13 years agoMerge branch 'jn/doc-pull'
Junio C Hamano [Fri, 13 Aug 2010 01:32:37 +0000 (18:32 -0700)] 
Merge branch 'jn/doc-pull'

* jn/doc-pull:
  Documentation: flesh out “git pull” description

13 years agoMerge branch 'jn/maint-gitweb-dynconf'
Junio C Hamano [Fri, 13 Aug 2010 01:32:31 +0000 (18:32 -0700)] 
Merge branch 'jn/maint-gitweb-dynconf'

* jn/maint-gitweb-dynconf:
  gitweb: allow configurations that change with each request

13 years agoMerge branch 'bc/use-more-hardlinks-in-install'
Junio C Hamano [Fri, 13 Aug 2010 01:32:20 +0000 (18:32 -0700)] 
Merge branch 'bc/use-more-hardlinks-in-install'

* bc/use-more-hardlinks-in-install:
  Makefile: make hard/symbolic links for non-builtins too
  Makefile: link builtins residing in bin directory to main git binary too

13 years agoMerge branch 'tr/rfc-reset-doc'
Junio C Hamano [Fri, 13 Aug 2010 01:31:43 +0000 (18:31 -0700)] 
Merge branch 'tr/rfc-reset-doc'

* tr/rfc-reset-doc:
  Documentation/reset: move "undo permanently" example behind "make topic"
  Documentation/reset: reorder examples to match description
  Documentation/reset: promote 'examples' one section up
  Documentation/reset: separate options by mode
  Documentation/git-reset: reorder modes for soft-mixed-hard progression

13 years agoMerge branch 'jn/parse-date-basic'
Junio C Hamano [Fri, 13 Aug 2010 01:31:03 +0000 (18:31 -0700)] 
Merge branch 'jn/parse-date-basic'

* jn/parse-date-basic:
  Export parse_date_basic() to convert a date string to timestamp

13 years agoMerge branch 'sp/fix-smart-http-deadlock-on-error'
Junio C Hamano [Fri, 13 Aug 2010 01:27:01 +0000 (18:27 -0700)] 
Merge branch 'sp/fix-smart-http-deadlock-on-error'

* sp/fix-smart-http-deadlock-on-error:
  smart-http: Don't deadlock on server failure

13 years agoMerge branch 'maint'
Junio C Hamano [Fri, 13 Aug 2010 01:07:09 +0000 (18:07 -0700)] 
Merge branch 'maint'

* maint:
  push: mention "git pull" in error message for non-fast forwards
  Standardize do { ... } while (0) style
  t/t7003: replace \t with literal tab in sed expression
  index-pack: Don't follow replace refs.

13 years agopush: mention "git pull" in error message for non-fast forwards
Matthieu Moy [Mon, 2 Aug 2010 13:42:44 +0000 (15:42 +0200)] 
push: mention "git pull" in error message for non-fast forwards

The message remains fuzzy to include "git pull", "git pull --rebase" and
others, but directs the user to the simplest solution in the vast
majority of cases.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoStandardize do { ... } while (0) style
Jonathan Nieder [Thu, 12 Aug 2010 22:11:15 +0000 (17:11 -0500)] 
Standardize do { ... } while (0) style

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/t7003: replace \t with literal tab in sed expression
Brandon Casey [Thu, 12 Aug 2010 20:55:54 +0000 (15:55 -0500)] 
t/t7003: replace \t with literal tab in sed expression

The sed utilities on IRIX and Solaris do not interpret the sequence '\t'
to mean a tab character;  they read a literal character 't'.  So, use a
literal tab instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoindex-pack: Don't follow replace refs.
Nelson Elhage [Thu, 12 Aug 2010 14:18:12 +0000 (10:18 -0400)] 
index-pack: Don't follow replace refs.

Without this, attempting to index a pack containing objects that have been
replaced results in a fatal error that looks like:

fatal: SHA1 COLLISION FOUND WITH <replaced-object> !

Signed-off-by: Nelson Elhage <nelhage@ksplice.com>
Acked-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jn/parse-date-basic' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:33 +0000 (14:22 -0700)] 
Merge branch 'jn/parse-date-basic' into next

* jn/parse-date-basic:
  Export parse_date_basic() to convert a date string to timestamp

13 years agoMerge branch 'tr/rfc-reset-doc' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:32 +0000 (14:22 -0700)] 
Merge branch 'tr/rfc-reset-doc' into next

* tr/rfc-reset-doc:
  Documentation/reset: move "undo permanently" example behind "make topic"
  Documentation/reset: reorder examples to match description
  Documentation/reset: promote 'examples' one section up
  Documentation/reset: separate options by mode
  Documentation/git-reset: reorder modes for soft-mixed-hard progression

13 years agoMerge branch 'jh/graph-next-line' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:32 +0000 (14:22 -0700)] 
Merge branch 'jh/graph-next-line' into next

* jh/graph-next-line:
  Enable custom schemes for column colors in the graph API
  Make graph_next_line() available in the graph.h API

13 years agoMerge branch 'ar/string-list-foreach' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:31 +0000 (14:22 -0700)] 
Merge branch 'ar/string-list-foreach' into next

* ar/string-list-foreach:
  Convert the users of for_each_string_list to for_each_string_list_item macro
  Add a for_each_string_list_item macro

13 years agoMerge branch 'hv/submodule-find-ff-merge' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:31 +0000 (14:22 -0700)] 
Merge branch 'hv/submodule-find-ff-merge' into next

* hv/submodule-find-ff-merge:
  Implement automatic fast-forward merge for submodules
  setup_revisions(): Allow walking history in a submodule
  Teach ref iteration module about submodules

13 years agoMerge branch 'jn/fast-import-subtree' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:31 +0000 (14:22 -0700)] 
Merge branch 'jn/fast-import-subtree' into next

* jn/fast-import-subtree:
  Teach fast-import to import subtrees named by tree id

13 years agoMerge branch 'tc/checkout-B' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:31 +0000 (14:22 -0700)] 
Merge branch 'tc/checkout-B' into next

* tc/checkout-B:
  builtin/checkout: handle -B from detached HEAD correctly
  builtin/checkout: learn -B
  builtin/checkout: reword hint for -b
  add tests for checkout -b

13 years agoMerge branch 'tr/xsize-bits' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:29 +0000 (14:22 -0700)] 
Merge branch 'tr/xsize-bits' into next

* tr/xsize-bits:
  xsize_t: check whether we lose bits

13 years agoMerge branch 'sp/fix-smart-http-deadlock-on-error' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:29 +0000 (14:22 -0700)] 
Merge branch 'sp/fix-smart-http-deadlock-on-error' into next

* sp/fix-smart-http-deadlock-on-error:
  smart-http: Don't deadlock on server failure

13 years agoMerge branch 'bc/use-more-hardlinks-in-install' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:28 +0000 (14:22 -0700)] 
Merge branch 'bc/use-more-hardlinks-in-install' into next

* bc/use-more-hardlinks-in-install:
  Makefile: make hard/symbolic links for non-builtins too
  Makefile: link builtins residing in bin directory to main git binary too

13 years agoMerge branch 'jn/maint-gitweb-dynconf' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:28 +0000 (14:22 -0700)] 
Merge branch 'jn/maint-gitweb-dynconf' into next

* jn/maint-gitweb-dynconf:
  gitweb: allow configurations that change with each request

13 years agoMerge branch 'jn/doc-pull' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:28 +0000 (14:22 -0700)] 
Merge branch 'jn/doc-pull' into next

* jn/doc-pull:
  Documentation: flesh out “git pull” description

13 years agoMerge branch 'jc/sha1-name-find-fix' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:28 +0000 (14:22 -0700)] 
Merge branch 'jc/sha1-name-find-fix' into next

* jc/sha1-name-find-fix:
  sha1_name.c: fix parsing of ":/token" syntax

Conflicts:
sha1_name.c

13 years agoMerge branch 'master' into next
Junio C Hamano [Wed, 11 Aug 2010 21:22:07 +0000 (14:22 -0700)] 
Merge branch 'master' into next

* master:
  post-receive-email: remove spurious commas in email subject
  fast-import: export correctly marks larger than 2^20-1
  t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH
  diff: strip extra "/" when stripping prefix

13 years agoMerge branch 'maint'
Junio C Hamano [Wed, 11 Aug 2010 18:32:00 +0000 (11:32 -0700)] 
Merge branch 'maint'

* maint:
  post-receive-email: remove spurious commas in email subject
  fast-import: export correctly marks larger than 2^20-1
  t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH
  diff: strip extra "/" when stripping prefix

13 years agopost-receive-email: remove spurious commas in email subject
Matthieu Moy [Wed, 11 Aug 2010 08:14:13 +0000 (10:14 +0200)] 
post-receive-email: remove spurious commas in email subject

The previous form produced subjects like

  [SCM] project.git branch, foo, updated. ...

The new one will produce the lighter

  [SCM] project.git branch foo updated. ...

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofast-import: export correctly marks larger than 2^20-1
Raja R Harinath [Tue, 13 Jul 2010 11:51:48 +0000 (17:21 +0530)] 
fast-import: export correctly marks larger than 2^20-1

dump_marks_helper() has a bug when dumping marks larger than 2^20-1,
i.e., when the sparse array has more than two levels.  The bug was
that the 'base' counter was being shifted by 20 bits at level 3, and
then again by 10 bits at level 2, rather than a total shift of 20 bits
in this argument to the recursive call:

  (base + k) << m->shift

There are two ways to fix this correctly, the elegant:

  (base + k) << 10

and the one I chose due to edit distance:

  base + (k << m->shift)

Signed-off-by: Raja R Harinath <harinath@hurrynot.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH
Ævar Arnfjörð Bjarmason [Tue, 10 Aug 2010 12:14:25 +0000 (12:14 +0000)] 
t/lib-git-svn.sh: use $PERL_PATH for perl, not perl from $PATH

Change the git-svn tests to use $PERL_PATH, not the "perl" in $PATH.

Using perl in $PATH was added by Sam Vilain in v1.6.6-rc0~95^2~3,
Philippe Bruhat introduced $PERL_PATH to the test suite in
v1.6.6-rc0~9^2, but the lib-git-svn.sh tests weren't updated to use
the new convention.

This resulted in the git-svn tests always being skipped on my
system. My /usr/bin/perl has access to SVN::Core and SVN::Repos, but
the perl in my $PATH does not.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff: strip extra "/" when stripping prefix
Jakub Narebski [Mon, 9 Aug 2010 14:50:53 +0000 (10:50 -0400)] 
diff: strip extra "/" when stripping prefix

There are two ways a user might want to use "diff --relative":

  1. For a file in a directory, like "subdir/file", the user
     can use "--relative=subdir/" to strip the directory.

  2. To strip part of a filename, like "foo-10", they can
     use "--relative=foo-".

We currently handle both of those situations. However, if the user passes
"--relative=subdir" (without the trailing slash), we produce inconsistent
results. For the unified diff format, we collapse the double-slash of
"a//file" correctly into "a/file". But for other formats (raw, stat,
name-status), we end up with "/file".

We can do what the user means here and strip the extra "/" (and only a
slash).  We are not hurting any existing users of (2) above with this
behavior change because the existing output for this case was nonsensical.

Patch by Jakub, tests and commit message by Jeff King.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'master' into next
Junio C Hamano [Mon, 9 Aug 2010 20:07:33 +0000 (13:07 -0700)] 
Merge branch 'master' into next

* master:
  gitweb: clarify search results page when no matching commit found
  Documentation: add a FILES section for show-ref
  Makefile: add missing dependency on http.h
  Makefile: add missing dependencies on url.h
  Documentation/git-log: Clarify --full-diff
  git-rebase: fix typo when parsing --force-rebase
  imap-send: Fix sprintf usage
  prune: allow --dry-run for -n and --verbose for -v
  notes: allow --dry-run for -n and --verbose for -v
  Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
  Documentation: cite git-am from git-apply
  t7003: fix subdirectory-filter test
  Allow "check-ref-format --branch" from subdirectory
  check-ref-format: handle subcommands in separate functions
  pretty-options.txt: match --format's documentation with implementation.
  instaweb: add access+error logging for WEBrick
  instaweb: minimize moving parts for WEBrick
  instaweb: fix WEBrick server support
  git svn: URL-decode left-hand side of svn refspec

13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 9 Aug 2010 20:05:47 +0000 (13:05 -0700)] 
Merge branch 'maint'

* maint:
  gitweb: clarify search results page when no matching commit found
  Documentation: add a FILES section for show-ref
  Makefile: add missing dependency on http.h
  Makefile: add missing dependencies on url.h
  Documentation/git-log: Clarify --full-diff
  git-rebase: fix typo when parsing --force-rebase
  imap-send: Fix sprintf usage
  prune: allow --dry-run for -n and --verbose for -v
  notes: allow --dry-run for -n and --verbose for -v
  Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
  Documentation: cite git-am from git-apply
  t7003: fix subdirectory-filter test
  Allow "check-ref-format --branch" from subdirectory
  check-ref-format: handle subcommands in separate functions
  pretty-options.txt: match --format's documentation with implementation.

13 years agogitweb: clarify search results page when no matching commit found
Jonathan Nieder [Sat, 7 Aug 2010 21:56:47 +0000 (16:56 -0500)] 
gitweb: clarify search results page when no matching commit found

When searching commits for a string that never occurs, the results
page looks something like this:

projects / foo.git / search                                 \o/
summary | ... | tree          [commit] search: [ kfjdkas ] [ ]re
first ⋅ prev ⋅ next

Merge branch 'maint'

Foo: a demonstration project

Without a list of hits to compare it to, the header describing the
commit named by the hash parameter (usually HEAD) may itself look
like a hit.  Add some text (“No match.”) to replace the empty
list of hits and avoid this confusion.

While at it, remove some nearby dead code, left behind from a
simplification a few years ago (v1.5.4-rc0~276^2~4, 2007-11-01).

Noticed-by: Erick Mattos <erick.mattos@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobuiltin/checkout: handle -B from detached HEAD correctly
Tay Ray Chuan [Mon, 9 Aug 2010 16:52:26 +0000 (00:52 +0800)] 
builtin/checkout: handle -B from detached HEAD correctly

Ensure that strcmp() isn't called when head is null.

Previously we were getting segfaults when checkout -B was done from a
detached HEAD.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: add a FILES section for show-ref
Jonathan Nieder [Mon, 9 Aug 2010 01:32:43 +0000 (20:32 -0500)] 
Documentation: add a FILES section for show-ref

A peek at where the refs are kept might help understanding, even if,
as the DESCRIPTION section suggests, direct access is not part of the
public API.

Balance that out with a pointer to update-ref.

Suggested-by: Geoff Russell <geoffrey.russell@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agounpack-trees: mark new entries skip-worktree appropriately
Nguyễn Thái Ngọc Duy [Sat, 31 Jul 2010 06:14:29 +0000 (13:14 +0700)] 
unpack-trees: mark new entries skip-worktree appropriately

Sparse checkout narrows worktree down based on the skip-worktree bit
before and after $GIT_DIR/info/sparse-checkout application. If it does
not have that bit before but does after, a narrow is detected and the
file will be removed from worktree.

New files added by merge, however, does not have skip-worktree bit. If
those files appear to be outside checkout area, the same rule applies:
the file gets removed from worktree even though they don't exist in
worktree.

Just pretend they have skip-worktree before in that case, so the rule
is ignored.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agounpack-trees: do not check for conflict entries too early
Nguyễn Thái Ngọc Duy [Sat, 31 Jul 2010 06:14:28 +0000 (13:14 +0700)] 
unpack-trees: do not check for conflict entries too early

The idea of sparse checkout is conflict entries should always stay
in worktree, regardless $GIT_DIR/info/sparse-checkout. Therefore,
ce_stage(ce) usually means no CE_SKIP_WORKTREE. This is true when all
entries have been merged into the index, and identical staged entries
collapsed.

However, will_have_skip_worktree() since f1f523e (unpack-trees():
ignore worktree check outside checkout area) is also used earlier in
verify_* functions, where entries have not been merged to index yet
and ce_stage() is not zero. Checking ce_stage() then may provoke
unnecessary verification on entries outside checkout area and error
out.

This fixes part of test case "read-tree adds to worktree, dirty case".
The error

error: Untracked working tree file 'sub/added' would be overwritten by merge.

is now gone and (unfortunately) replaced by another error, which will
be addressed in the next patch.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agounpack-trees: let read-tree -u remove index entries outside sparse area
Nguyễn Thái Ngọc Duy [Sat, 31 Jul 2010 06:14:27 +0000 (13:14 +0700)] 
unpack-trees: let read-tree -u remove index entries outside sparse area

To avoid touching the worktree outside a sparse checkout,
when the update flag is enabled unpack_trees() clears the
CE_UPDATE and CE_REMOVE flags on entries that do not match the
sparse pattern before actually committing any updates to the
index file or worktree.

The effect on the index was unintentional; sparse checkout was
never meant to prevent index updates outside the area checked
out.  And the result is very confusing: for example, after a
failed merge, currently "git reset --hard" does not reset the
state completely but an additional "git reset --mixed" will.

So stop clearing the CE_REMOVE flag.  Instead, maintain a
CE_WT_REMOVE flag to separately track whether a particular
file removal should apply to the worktree in addition to the
index or not.

The CE_WT_REMOVE flag is used already to mark files that
should be removed because of a narrowing checkout area.  That
usage will still apply; do not clear the CE_WT_REMOVE flag
in that case (detectable because the CE_REMOVE flag is not
set).

This bug masked some other bugs illustrated by the test
suite, which will be addressed by later patches.

Reported-by: Frédéric Brière <fbriere@fbriere.net>
Fixes: http://bugs.debian.org/583699

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agounpack-trees: only clear CE_UPDATE|CE_REMOVE when skip-worktree is always set
Nguyễn Thái Ngọc Duy [Sat, 31 Jul 2010 06:14:26 +0000 (13:14 +0700)] 
unpack-trees: only clear CE_UPDATE|CE_REMOVE when skip-worktree is always set

The purpose of this clearing is, as explained in comment, because
verify_*() may set those bits before apply_sparse_checkout() is
called. By that time, it's not clear whether an entry will stay in
checkout area or out. After $GIT_DIR/info/sparse-checkout is applied,
we know what entries will be in finally. It's time to clean unwanted
bits.

That works perfectly when checkout area remains unchanged. When
checkout area changes, apply_sparse_checkout() may set CE_UPDATE
or CE_WT_REMOVE to widen/narrow checkout area. Doing the clearing
after apply_sparse_checkout() may clear those widening/narrowing
bits unexpectedly.

So, only do that on entries that are not affected by checkout area
changes (i.e. skip-worktree bit does not change after
apply_sparse_checkout).

This code does not actually fix anything though, just
future-proof. The removed code and the narrow/widen code inside
apply_sparse_checkout are currently independent (narrow code never
sets CE_REMOVE, widen code sets CE_UPDATE, but ce_skip_worktree()
would be false).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMakefile: add missing dependency on http.h
Jonathan Nieder [Sun, 8 Aug 2010 21:48:59 +0000 (16:48 -0500)] 
Makefile: add missing dependency on http.h

v1.7.1-rc0~65^2~2 (http: init and cleanup separately from
http-walker, 2010-03-02) introduced a direct dependency from
http-fetch on the HTTP request library.  Declare it.

Detected with "make CHECK_HEADER_DEPENDENCIES=1".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMakefile: add missing dependencies on url.h
Jonathan Nieder [Sun, 8 Aug 2010 21:25:11 +0000 (16:25 -0500)] 
Makefile: add missing dependencies on url.h

v1.7.2-rc0~56^2 and its parent (decode file:// and ssh://
URLs, 2010-05-23) introduced a new url library.  Update the
Makefile with the relevant dependencies.

Detected with "make CHECK_HEADER_DEPENDENCIES=1".

Cc: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/git-log: Clarify --full-diff
Michael J Gruber [Sun, 8 Aug 2010 15:31:34 +0000 (17:31 +0200)] 
Documentation/git-log: Clarify --full-diff

The current description gives the impression that "--full-diff" affects
"log -p" only.

Make it clearer that it affects all diff-based output types.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-rebase: fix typo when parsing --force-rebase
Willy Tarreau [Sun, 8 Aug 2010 05:13:32 +0000 (07:13 +0200)] 
git-rebase: fix typo when parsing --force-rebase

Due to two missing hyphens, The "force" keyword on the command line
would be taken as an alias for the --force-rebase option.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoimap-send: Fix sprintf usage
Ævar Arnfjörð Bjarmason [Sat, 7 Aug 2010 23:09:45 +0000 (18:09 -0500)] 
imap-send: Fix sprintf usage

When composing a command for the imap server, imap-send uses a single
nfsnprintf() invocation for brevity instead of dealing separately with
the case when there is a message to be sent and the case when there
isn’t.  The unused argument in the second case, while valid, is
confusing for static analyzers and human readers.

v1.6.4-rc0~117 (imap-send: add support for IPv6, 2009-05-25)
mistakenly used %hu as the format for an int “port”, by analogy with
existing usage for the unsigned short “addr.sin_port”.  Use %d
instead.

Noticed with clang.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoprune: allow --dry-run for -n and --verbose for -v
René Scharfe [Fri, 6 Aug 2010 20:28:05 +0000 (22:28 +0200)] 
prune: allow --dry-run for -n and --verbose for -v

For consistency with other git commands, let git prune accept the long
options --dry-run and --verbose for the respective short ones -n and -v.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agonotes: allow --dry-run for -n and --verbose for -v
René Scharfe [Fri, 6 Aug 2010 20:28:09 +0000 (22:28 +0200)] 
notes: allow --dry-run for -n and --verbose for -v

For consistency with other git commands, let the prune subcommand of
git notes accept the long options --dry-run and --verbose for the
respective short ones -n and -v.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'webrick' of git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 9 Aug 2010 16:46:52 +0000 (09:46 -0700)] 
Merge branch 'webrick' of git://git.bogomips.org/git-svn

* 'webrick' of git://git.bogomips.org/git-svn:
  instaweb: add access+error logging for WEBrick
  instaweb: minimize moving parts for WEBrick
  instaweb: fix WEBrick server support

13 years agoDocument -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
Matthieu Moy [Thu, 5 Aug 2010 16:14:25 +0000 (18:14 +0200)] 
Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C

These options take an optional argument, but this optional argument was
not documented.

Original patch by Matthieu Moy, but documentation for -B mostly copied
from the explanations of Junio C Hamano.

While we're there, fix a typo in a comment in diffcore.h.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: cite git-am from git-apply
Brad King [Tue, 3 Aug 2010 18:41:50 +0000 (14:41 -0400)] 
Documentation: cite git-am from git-apply

Users reading git-apply documentation may also be interested in git-am,
especially after receiving an email created with git-format-patch.  The
documentation for git-am already references git-apply.  Add the reverse.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7003: fix subdirectory-filter test
Thomas Rast [Thu, 29 Jul 2010 15:10:22 +0000 (17:10 +0200)] 
t7003: fix subdirectory-filter test

The test would not fail if the filtering failed to do anything, since
in

  test -z "$(git diff HEAD directorymoved:newsubdir)"'

'directorymoved:newsubdir' is not valid, so git-diff fails without
printing anything on stdout.  But then the exit status of git-diff is
lost, whereas test -z "" succeeds.

Use 'git diff --exit-code' instead, which does the right thing and has
the added bonus of showing the differences if there are any.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosmart-http: Don't deadlock on server failure
Shawn O. Pearce [Fri, 6 Aug 2010 21:19:44 +0000 (14:19 -0700)] 
smart-http: Don't deadlock on server failure

If the remote HTTP server fails (e.g. returns 404 or 500) when we
posted the RPC to it, we won't have sent anything to the background
Git process that is supposed to handle the stream.  Because we
didn't send anything, its waiting for input from remote-curl, and
remote-curl cannot read its response payload because doing so would
lead to a deadlock.

Send the background task EOF on its input before we try to read
its response back, that way it will break out of its read loop
and terminate.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAllow "check-ref-format --branch" from subdirectory
Jonathan Nieder [Fri, 6 Aug 2010 03:39:22 +0000 (22:39 -0500)] 
Allow "check-ref-format --branch" from subdirectory

check-ref-format --branch requires access to the repository
to resolve refs like @{-1}.

Noticed by Nguyễn Thái Ngọc Duy.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheck-ref-format: handle subcommands in separate functions
Jonathan Nieder [Fri, 6 Aug 2010 03:36:07 +0000 (22:36 -0500)] 
check-ref-format: handle subcommands in separate functions

The code for each subcommand should be easier to read and manipulate
this way.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agolog: parse separate option for --glob
Matthieu Moy [Thu, 5 Aug 2010 08:22:56 +0000 (10:22 +0200)] 
log: parse separate option for --glob

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agolog: parse separate options like git log --grep foo
Matthieu Moy [Thu, 5 Aug 2010 08:22:55 +0000 (10:22 +0200)] 
log: parse separate options like git log --grep foo

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff: parse separate options --stat-width n, --stat-name-width n
Matthieu Moy [Thu, 5 Aug 2010 08:22:54 +0000 (10:22 +0200)] 
diff: parse separate options --stat-width n, --stat-name-width n

Part of a campaign for unstuck forms of options.

[jn: with some refactoring]

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff: split off a function for --stat-* option parsing
Jonathan Nieder [Thu, 5 Aug 2010 08:22:53 +0000 (10:22 +0200)] 
diff: split off a function for --stat-* option parsing

As an optimization, the diff_opt_parse() switchboard has
a single case for all the --stat-* options.  Split it
off into a separate function so we can enhance it
without bringing code dangerously close to the right
margin.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff: parse separate options like -S foo
Matthieu Moy [Thu, 5 Aug 2010 08:22:52 +0000 (10:22 +0200)] 
diff: parse separate options like -S foo

Change the option parsing logic in revision.c to accept separate forms
like `-S foo' in addition to `-Sfoo'. The rest of git already accepted
this form, but revision.c still used its own option parsing.

Short options affected are -S<string>, -l<num> and -O<orderfile>, for
which an empty string wouldn't make sense, hence -<option> <arg> isn't
ambiguous.

This patch does not handle --stat-name-width and --stat-width, which are
special-cases where diff_long_opt do not apply. They are handled in a
separate patch to ease review.

Original patch by Matthieu Moy, plus refactoring by Jonathan Nieder.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Fri, 6 Aug 2010 16:06:20 +0000 (09:06 -0700)] 
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git svn: URL-decode left-hand side of svn refspec

13 years agopretty-options.txt: match --format's documentation with implementation.
Matthieu Moy [Thu, 5 Aug 2010 13:08:05 +0000 (15:08 +0200)] 
pretty-options.txt: match --format's documentation with implementation.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoinstaweb: add access+error logging for WEBrick
Eric Wong [Thu, 5 Aug 2010 08:46:04 +0000 (08:46 +0000)] 
instaweb: add access+error logging for WEBrick

This allows WEBrick to support all the logging functionality
in a manner consistent with the other web servers.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agoinstaweb: minimize moving parts for WEBrick
Eric Wong [Thu, 5 Aug 2010 08:35:45 +0000 (08:35 +0000)] 
instaweb: minimize moving parts for WEBrick

Since there are WEBrick configuration settings (including the
upcoming AccessLog support) that cannot be represented in YAML
and require Ruby anyways, the YAML config file is an unnecessary
layer of complexity.

Additionally, the shell script wrapper to start WEBrick is
unecessary since our generated Ruby script can be made
executable in the same manner with /usr/bin/env.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agoinstaweb: fix WEBrick server support
Eric Wong [Wed, 4 Aug 2010 09:51:25 +0000 (09:51 +0000)] 
instaweb: fix WEBrick server support

This has been broken since commit be5347b ("httpd logs in a
"$httpd_only" subdirectory").

Since WEBrick has no other way of preserving environment
variables needed for gitweb, we create a shell script wrapper
that sets the environment variables as our CGI interpreter
to run gitweb.cgi.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agogit svn: URL-decode left-hand side of svn refspec
Steven Walter [Tue, 3 Aug 2010 23:21:25 +0000 (19:21 -0400)] 
git svn: URL-decode left-hand side of svn refspec

This change allows git-svn to handle an URL with colons in the path

[ew: rewritten to use uri_decode() function]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
13 years agoMerge branch 'en/d-f-conflict-fix' into next
Junio C Hamano [Tue, 3 Aug 2010 22:26:08 +0000 (15:26 -0700)] 
Merge branch 'en/d-f-conflict-fix' into next

* en/d-f-conflict-fix:
  t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
  fast-import: Improve robustness when D->F changes provided in wrong order
  fast-export: Fix output order of D/F changes
  merge_recursive: Fix renames across paths below D/F conflicts
  merge-recursive: Fix D/F conflicts
  Add a rename + D/F conflict testcase
  Add additional testcases for D/F conflicts

13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 3 Aug 2010 22:20:01 +0000 (15:20 -0700)] 
Merge branch 'maint'

* maint:
  contrib/svn-fe: Add the svn-fe target to .gitignore
  contrib/svn-fe: Fix IncludePath
  Fix DIFF_QUEUE_CLEAR refactoring
  git-gui: fix size and position of window panes on startup
  git-gui: mc cannot be used before msgcat has been loaded
  git-gui: use textconv filter for diff and blame
  git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
  git-gui: fix shortcut creation on cygwin
  git-gui: fix PATH environment for mingw development environment
  git-gui: fix usage of _gitworktree when creating shortcut for windows
  git-gui: fix "Explore Working Copy" for Windows again
  git-gui: fix usage of themed widgets variable
  git-gui: Handle failure of core.worktree to identify the working directory.
  git-gui: check whether systems nice command works or disable it

13 years agoMerge branch 'gp/pack-refs-remove-empty-dirs'
Junio C Hamano [Tue, 3 Aug 2010 22:19:02 +0000 (15:19 -0700)] 
Merge branch 'gp/pack-refs-remove-empty-dirs'

* gp/pack-refs-remove-empty-dirs:
  pack-refs: remove newly empty directories

13 years agoMerge branch 'sv/maint-diff-q-clear-fix' into maint
Junio C Hamano [Tue, 3 Aug 2010 22:17:34 +0000 (15:17 -0700)] 
Merge branch 'sv/maint-diff-q-clear-fix' into maint

* sv/maint-diff-q-clear-fix:
  Fix DIFF_QUEUE_CLEAR refactoring

13 years agoMerge branch 'rr/svn-fe' into maint
Junio C Hamano [Tue, 3 Aug 2010 22:17:11 +0000 (15:17 -0700)] 
Merge branch 'rr/svn-fe' into maint

* rr/svn-fe:
  contrib/svn-fe: Add the svn-fe target to .gitignore
  contrib/svn-fe: Fix IncludePath

13 years agoMerge branch 'pt/git-gui' into maint
Junio C Hamano [Tue, 3 Aug 2010 22:16:38 +0000 (15:16 -0700)] 
Merge branch 'pt/git-gui' into maint

* pt/git-gui:
  git-gui: fix size and position of window panes on startup
  git-gui: mc cannot be used before msgcat has been loaded
  git-gui: use textconv filter for diff and blame
  git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
  git-gui: fix shortcut creation on cygwin
  git-gui: fix PATH environment for mingw development environment
  git-gui: fix usage of _gitworktree when creating shortcut for windows
  git-gui: fix "Explore Working Copy" for Windows again
  git-gui: fix usage of themed widgets variable
  git-gui: Handle failure of core.worktree to identify the working directory.
  git-gui: check whether systems nice command works or disable it

13 years agorebase: support -X to pass through strategy options
Mike Lundy [Wed, 28 Jul 2010 22:04:29 +0000 (00:04 +0200)] 
rebase: support -X to pass through strategy options

git-rebase calls out to merge strategies, but did not support merge
strategy options so far.  Add this, in the same style used in
git-merge.

Sadly we have to do the full quoting/eval dance here, since
merge-recursive supports the --subtree=<path> option which potentially
contains whitespace.

This patch does not cover git rebase -i, which does not call any merge
strategy directly except in --preserve-merges, and even then only for
merges.

[jc: with a trivial fix-up for 'expr']

Signed-off-by: Mike Lundy <mike@fluffypenguin.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocontrib/svn-fe: Add the svn-fe target to .gitignore
Ramkumar Ramachandra [Thu, 29 Jul 2010 05:36:20 +0000 (11:06 +0530)] 
contrib/svn-fe: Add the svn-fe target to .gitignore

Add the svn-fe target to .gitignroe.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocontrib/svn-fe: Fix IncludePath
Ramkumar Ramachandra [Thu, 29 Jul 2010 05:36:19 +0000 (11:06 +0530)] 
contrib/svn-fe: Fix IncludePath

Include the path "../../vcs-svn" while compiling it in the Makefile
and change svn-fe.c to include svndump.h.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: flesh out “git pull” description
Jonathan Nieder [Mon, 2 Aug 2010 21:39:30 +0000 (16:39 -0500)] 
Documentation: flesh out “git pull” description

The current description in the pull man page does not say much more
than that “git pull” is fetch + merge.  Though that is all a person
needs to know in the end, it would be useful to summarize a bit about
what those commands do for new readers.

Most of this description is taken from the “git merge” docs.

Now that we explain how to back out of a failed merge (reset --merge),
we can tone down the warning against that a bit.

Except, as Thomas noticed, there’s a risk with that because people
might read this version of the manpage online and then conclude that
it is safe to try a merge with uncommitted changes, only to find that
their “git reset” doesn't support --merge yet.  Or worse, verify that
their git-reset has --merge by a quick test (1b5b465 is in 1.6.2) but
then find that it does not help with backing out of a merge (e11d7b5
is only in 1.7.0!).  So keep the warning.

With clarifications from Ævar, Thomas, and Junio.

Noticed-by: Geoff Russell <geoffrey.russell@gmail.com>
Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 2 Aug 2010 22:38:55 +0000 (15:38 -0700)] 
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git svn: fix dcommit to work with touched files
  git svn: add an option to recode pathnames

13 years agoupload-pack: Improve error message when bad ref requested
Elijah Newren [Sat, 31 Jul 2010 20:11:46 +0000 (14:11 -0600)] 
upload-pack: Improve error message when bad ref requested

When printing an error message saying a ref was requested that we do not
have, only print that ref, rather than the ref and everything sent to us
on the same packet line (e.g. protocol support specifications).

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocument git-instaweb start/stop/restart
Jared Hance [Mon, 2 Aug 2010 18:20:38 +0000 (14:20 -0400)] 
Document git-instaweb start/stop/restart

The flags --start, --stop, and --restart can be used without the "--".
Document this feature.

Signed-off-by: Jared Hance <jaredhance@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Fix typo in run() subroutine
Jakub Narebski [Mon, 2 Aug 2010 20:21:47 +0000 (22:21 +0200)] 
gitweb: Fix typo in run() subroutine

Run $post_dispatch_hook->() not $pre_dispatch_hook->() after each
request.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosha1_name.c: fix parsing of ":/token" syntax
Junio C Hamano [Mon, 2 Aug 2010 21:37:06 +0000 (14:37 -0700)] 
sha1_name.c: fix parsing of ":/token" syntax

The parser tried to clean up the object flags it used while finding
commits with matching string, but was not doing a very good job at it.

This caused "checkout -b new ':/token'", which internally tries to parse
':/token' twice as an object name, to fail when the commit in question
was reachable from only one ref.

The mask bits given to pop_most_recent_commit(&list, MASK) means "I have
already been on the list to be processed, so please do not place me again
even if I am found to be a parent of some other commit on the list."  So
mark them when we add them to the list at the beginning.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit svn: fix dcommit to work with touched files
David D. Kilzer [Mon, 2 Aug 2010 19:58:19 +0000 (12:58 -0700)] 
git svn: fix dcommit to work with touched files

The dcommit command fails if an otherwise unmodified file has
been touched in the working directory:

    Cannot dcommit with a dirty index.  Commit your changes
    first, or stash them with `git stash'.

This happens because "git diff-index" reports a difference
between the index and the filesystem:

    :100644 100644 d00491...... 000000...... M      file

The fix is to run "git update-index --refresh" before
"git diff-index" as is done in git-rebase and
git-rebase--interactive before "git diff-files".

This changes dcommit to display a list of modified files before
exiting.

Also add a similar test case for "git svn rebase".

[ew: rearranged commit message subject]

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agols-files: learn a debugging dump format
Thomas Rast [Fri, 30 Jul 2010 22:35:59 +0000 (00:35 +0200)] 
ls-files: learn a debugging dump format

Teach git-ls-files a new option --debug that just tacks all available
data from the cache onto each file's line.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 2 Aug 2010 19:02:16 +0000 (12:02 -0700)] 
Merge branch 'maint'

* maint:
  test-lib: Remove 3 year old no-op --no-python option
  test-lib: Ignore --quiet under a TAP harness
  Documentation/rev-parse: quoting is required with --parseopt
  Documentation: reporting bugs
  Fix git rebase --continue to work with touched files
  Document ls-files -t as semi-obsolete.

13 years agoMerge branch 'ab/tap' into maint
Junio C Hamano [Mon, 2 Aug 2010 18:53:58 +0000 (11:53 -0700)] 
Merge branch 'ab/tap' into maint

* ab/tap:
  test-lib: Remove 3 year old no-op --no-python option
  test-lib: Ignore --quiet under a TAP harness

13 years agotest-lib: Remove 3 year old no-op --no-python option
Ævar Arnfjörð Bjarmason [Sat, 31 Jul 2010 16:49:53 +0000 (16:49 +0000)] 
test-lib: Remove 3 year old no-op --no-python option

The --no-python option was added to test-lib.sh by Johannes Schindelin
in early 2006 in abb7c7b3. It was later turned into a no-op by Junio C
Hamano in 7cdbff14 the same year.

Over three years is long enough before removing this old wart which
was retained for backwards compatibility. Our tests have been using
NO_PYTHON and "test_have_prereq PYTHON" for a long time now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: Ignore --quiet under a TAP harness
Ævar Arnfjörð Bjarmason [Sat, 31 Jul 2010 16:40:05 +0000 (16:40 +0000)] 
test-lib: Ignore --quiet under a TAP harness

Running the tests with --quiet under a TAP harness will always fail,
since a TAP harness always needs actual test output to go along with
the plan that's being emitted.

Change the test-lib.sh to ignore the --quiet option under
HARNESS_ACTIVE to work around this. Then users that have --quiet in
their GIT_TEST_OPTS can run tests under prove(1) without everything
breaking.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobuiltin/push.c: remove useless temporary variable
Jared Hance [Sat, 31 Jul 2010 12:54:55 +0000 (08:54 -0400)] 
builtin/push.c: remove useless temporary variable

Creating a variable nr here to use throughout the function only to change
refspec_nr to nr at the end, having not used refspec_nr the entire time,
is rather pointless. Instead, simply increment refspec_nr.

While at it, use ALLOC_GROW() instead of xrealloc().

Signed-off-by: Jared Hance <jaredhance@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: allow configurations that change with each request
Jonathan Nieder [Sat, 31 Jul 2010 03:01:59 +0000 (22:01 -0500)] 
gitweb: allow configurations that change with each request

gitolite's contrib/gitweb/gitweb.conf includes:

$ENV{GL_USER} = $cgi->remote_user || "gitweb";

which is useful for setups where a user has to be authenticated
to access certain repos.  Perhaps other typical configurations
change per session in other ways, too.

v1.7.2-rc2~6 (gitweb: Move evaluate_gitweb_config out of run_request,
2010-07-05) broke such configurations for a speedup, by loading
the configuration once per FastCGI process.

Probably in the end there should be a way to specify in the
configuration whether a particular installation wants the speedup or
the flexibility.  But for now it is easier to just undo the relevant
change.

This partially reverts commit 869d58813b24c74e84c9388041eafcef40cb51e4.

Reported-by: Julio Lajara <julio.lajara@alum.rpi.edu>
Analysis-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot1011 (sparse checkout): style nitpicks
Jonathan Nieder [Sat, 31 Jul 2010 06:14:25 +0000 (13:14 +0700)] 
t1011 (sparse checkout): style nitpicks

Tweak the rest of the script to more closely follow the test
style guide.  Guarding setup commands with test_expect_success
makes it easy to see the scope in which some particular data is
used; removal of whitespace after >redirection operators is just
for consistency.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>