git
13 years agoMerge branch 'jk/tag-contains-ab' (early part) into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:37 +0000 (15:47 -0700)] 
Merge branch 'jk/tag-contains-ab' (early part) into next

* 'jk/tag-contains-ab' (early part):
  default core.clockskew variable to one day
  limit "contains" traversals based on commit timestamp
  tag: speed up --contains calculation

13 years agoMerge branch 'jk/maint-config-param' into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:36 +0000 (15:47 -0700)] 
Merge branch 'jk/maint-config-param' into next

* jk/maint-config-param:
  config: use strbuf_split_str instead of a temporary strbuf
  strbuf: allow strbuf_split to work on non-strbufs
  config: avoid segfault when parsing command-line config
  config: die on error in command-line config
  fix "git -c" parsing of values with equals signs
  strbuf_split: add a max parameter

13 years agoMerge branch 'jk/tag-list-multiple-patterns' into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:36 +0000 (15:47 -0700)] 
Merge branch 'jk/tag-list-multiple-patterns' into next

* jk/tag-list-multiple-patterns:
  tag: accept multiple patterns for --list

13 years agoMerge branch 'jc/zlib-wrap' into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:36 +0000 (15:47 -0700)] 
Merge branch 'jc/zlib-wrap' into next

* jc/zlib-wrap:
  zlib: allow feeding more than 4GB in one go
  zlib: zlib can only process 4GB at a time
  zlib: wrap deflateBound() too
  zlib: wrap deflate side of the API
  zlib: wrap inflateInit2 used to accept only for gzip format
  zlib: wrap remaining calls to direct inflate/inflateEnd
  zlib wrapper: refactor error message formatter

Conflicts:
sha1_file.c

13 years agoMerge branch 'jc/index-pack' into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:35 +0000 (15:47 -0700)] 
Merge branch 'jc/index-pack' into next

* jc/index-pack:
  verify-pack: use index-pack --verify
  index-pack: show histogram when emulating "verify-pack -v"
  index-pack: start learning to emulate "verify-pack -v"
  index-pack: a miniscule refactor
  index-pack --verify: read anomalous offsets from v2 idx file
  write_idx_file: need_large_offset() helper function
  index-pack: --verify
  write_idx_file: introduce a struct to hold idx customization options
  index-pack: group the delta-base array entries also by type

Conflicts:
builtin/verify-pack.c
cache.h
sha1_file.c

13 years agoMerge branch 'jc/submodule-sync-no-auto-vivify' into next
Junio C Hamano [Tue, 5 Jul 2011 22:47:35 +0000 (15:47 -0700)] 
Merge branch 'jc/submodule-sync-no-auto-vivify' into next

* jc/submodule-sync-no-auto-vivify:
  submodule add: always initialize .git/config entry
  submodule sync: do not auto-vivify uninteresting submodule

Conflicts:
git-submodule.sh

13 years agoMerge branch 'aw/rebase-i-p' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:46 +0000 (11:52 -0700)] 
Merge branch 'aw/rebase-i-p' into next

* aw/rebase-i-p:
  rebase -i -p: include non-first-parent commits in todo list

13 years agoMerge branch 'jl/maint-fetch-recursive-fix' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:46 +0000 (11:52 -0700)] 
Merge branch 'jl/maint-fetch-recursive-fix' into next

* jl/maint-fetch-recursive-fix:
  fetch: Also fetch submodules in subdirectories in on-demand mode

13 years agoMerge branch 'fg/submodule-keep-updating' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:46 +0000 (11:52 -0700)] 
Merge branch 'fg/submodule-keep-updating' into next

* fg/submodule-keep-updating:
  git-submodule.sh: clarify the "should we die now" logic
  submodule update: continue when a checkout fails
  git-sh-setup: add die_with_status

Conflicts:
git-submodule.sh

13 years agoMerge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:46 +0000 (11:52 -0700)] 
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into next

* bc/submodule-foreach-stdin-fix-1.7.4:
  git-submodule.sh: preserve stdin for the command spawned by foreach
  t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin

Conflicts:
git-submodule.sh

13 years agoMerge branch 'jc/maint-cygwin-trust-executable-bit-default' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:45 +0000 (11:52 -0700)] 
Merge branch 'jc/maint-cygwin-trust-executable-bit-default' into next

* jc/maint-cygwin-trust-executable-bit-default:
  cygwin: trust executable bit by default

13 years agoMerge branch 'rj/config-cygwin' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:45 +0000 (11:52 -0700)] 
Merge branch 'rj/config-cygwin' into next

* rj/config-cygwin:
  config.c: Make git_config() work correctly when called recursively
  t1301-*.sh: Fix the 'forced modes' test on cygwin
  help.c: Fix detection of custom merge strategy on cygwin

13 years agoMerge branch 'ak/gcc46-profile-feedback' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:45 +0000 (11:52 -0700)] 
Merge branch 'ak/gcc46-profile-feedback' into next

* ak/gcc46-profile-feedback:
  Add explanation of the profile feedback build to the README
  Add profile feedback build to git
  Add option to disable NORETURN

13 years agoMerge branch 'md/interix-update' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'md/interix-update' into next

* md/interix-update:
  Update the Interix default build configuration.

13 years agoMerge branch 'js/rebase-typo-branch-squelch-usage' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'js/rebase-typo-branch-squelch-usage' into next

* js/rebase-typo-branch-squelch-usage:
  rebase: do not print lots of usage hints after an obvious error message

13 years agoMerge branch 'ln/gitweb-mime-types-split-at-blank' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'ln/gitweb-mime-types-split-at-blank' into next

* ln/gitweb-mime-types-split-at-blank:
  gitweb: allow space as delimiter in mime.types

13 years agoMerge branch 'fk/relink-upon-ldflags-update' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'fk/relink-upon-ldflags-update' into next

* fk/relink-upon-ldflags-update:
  Makefile: Track changes to LDFLAGS and relink when necessary

13 years agoMerge branch 'jc/legacy-loose-object' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'jc/legacy-loose-object' into next

* jc/legacy-loose-object:
  sha1_file.c: "legacy" is really the current format

13 years agoMerge branch 'jn/doc-dashdash' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:44 +0000 (11:52 -0700)] 
Merge branch 'jn/doc-dashdash' into next

* jn/doc-dashdash:
  Documentation/i18n: quote double-dash for AsciiDoc

13 years agoMerge branch 'jn/maint-doc-dashdash' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:43 +0000 (11:52 -0700)] 
Merge branch 'jn/maint-doc-dashdash' into next

* jn/maint-doc-dashdash:
  Documentation: quote double-dash for AsciiDoc

13 years agoMerge branch 'nk/ref-doc' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:43 +0000 (11:52 -0700)] 
Merge branch 'nk/ref-doc' into next

* nk/ref-doc:
  glossary: clarify description of HEAD
  glossary: update description of head and ref
  glossary: update description of "tag"
  git.txt: de-emphasize the implementation detail of a ref
  check-ref-format doc: de-emphasize the implementation detail of a ref
  git-remote.txt: avoid sounding as if loose refs are the only ones in the world
  git-remote.txt: fix wrong remote refspec

13 years agoMerge branch 'an/shallow-doc' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:43 +0000 (11:52 -0700)] 
Merge branch 'an/shallow-doc' into next

* an/shallow-doc:
  Document the underlying protocol used by shallow repositories and --depth commands.
  Fix documentation of fetch-pack that implies that the client can disconnect after sending wants.

13 years agoMerge branch 'jc/no-gitweb-test-without-cgi-etc' into next
Junio C Hamano [Fri, 1 Jul 2011 18:52:43 +0000 (11:52 -0700)] 
Merge branch 'jc/no-gitweb-test-without-cgi-etc' into next

* jc/no-gitweb-test-without-cgi-etc:
  t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

13 years agogit-submodule.sh: preserve stdin for the command spawned by foreach
Brandon Casey [Thu, 30 Jun 2011 00:34:58 +0000 (19:34 -0500)] 
git-submodule.sh: preserve stdin for the command spawned by foreach

The user-supplied command spawned by 'submodule foreach' loses its
connection to the original standard input.  Instead, it is connected to the
output of a pipe within the git-submodule script.  The user-supplied
command supplied to 'submodule foreach' is spawned within a while loop
which is being piped into.  Due to the way shells implement piping output
to a while loop, a subshell is created with its standard input attached to
the output of the pipe.  This results in all of the commands executed
within the while loop to have their stdins modified in the same way,
including the user-supplied command.

This can cause a problem if the command requires reading from stdin or if
it changes its behavior based on whether stdin is a tty or not.  For
example, this problem was noticed when trying to execute the following:

   git submodule foreach git shortlog --since=two.weeks.ago

which printed a message about entering the first submodule and produced no
further output and exited with a status of zero.  In this case, shortlog
detected that it was not connected to a tty, and since no revision was
supplied as an argument, it attempted to read the list of revisions from
standard input.  Instead, it slurped up the list of submodules that was
being piped to the enclosing while loop and caused that loop to end early
without processing the remaining submodules.

Work around this behavior by saving the original standard input file
descriptor before the while loop, and restoring it when spawning the
user-supplied command.

This fixes the tests in t7407.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/t7407: demonstrate that the command called by 'submodule foreach' loses stdin
Brandon Casey [Thu, 30 Jun 2011 00:34:57 +0000 (19:34 -0500)] 
t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin

The user-supplied command spawned by 'submodule foreach' loses its
connection to the original standard input.  Instead, it is connected to the
output of a pipe within the git-submodule script.  This can cause a problem
if the command requires reading from stdin or if it changes its behavior
based on whether stdin is a tty or not (e.g. git shortlog).  Demonstrate
this flaw.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jc/streaming-filter' into next
Junio C Hamano [Thu, 30 Jun 2011 00:09:28 +0000 (17:09 -0700)] 
Merge branch 'jc/streaming-filter' into next

* jc/streaming-filter:
  t0021: test application of both crlf and ident
  t0021-conversion.sh: fix NoTerminatingSymbolAtEOF test
  streaming: filter cascading
  streaming filter: ident filter
  Add LF-to-CRLF streaming conversion
  stream filter: add "no more input" to the filters
  Add streaming filter API
  convert.h: move declarations for conversion from cache.h

13 years agoMerge branch 'jn/gitweb-js-blame' into next
Junio C Hamano [Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)] 
Merge branch 'jn/gitweb-js-blame' into next

* jn/gitweb-js-blame:
  gitweb.js: use setTimeout rather than setInterval in blame_incremental.js
  gitweb.js: No need for loop in blame_incremental's handleResponse()
  gitweb.js: No need for inProgress in blame_incremental.js

13 years agoMerge branch 'da/git-prefix-everywhere' into next
Junio C Hamano [Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)] 
Merge branch 'da/git-prefix-everywhere' into next

* da/git-prefix-everywhere:
  t/t7503-pre-commit-hook.sh: Add GIT_PREFIX tests
  git-mergetool--lib: Make vimdiff retain the current directory
  git: Remove handling for GIT_PREFIX
  setup: Provide GIT_PREFIX to built-ins

13 years agoMerge branch 'jc/streaming' into next
Junio C Hamano [Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)] 
Merge branch 'jc/streaming' into next

* jc/streaming:
  sha1_file: use the correct type (ssize_t, not size_t) for read-style function
  streaming: read loose objects incrementally
  sha1_file.c: expose helpers to read loose objects
  streaming: read non-delta incrementally from a pack
  streaming_write_entry(): support files with holes
  convert: CRLF_INPUT is a no-op in the output codepath
  streaming_write_entry(): use streaming API in write_entry()
  streaming: a new API to read from the object store
  write_entry(): separate two helper functions out
  unpack_object_header(): make it public
  sha1_object_info_extended(): hint about objects in delta-base cache
  sha1_object_info_extended(): expose a bit more info
  packed_object_info_detail(): do not return a string

13 years agoMerge branch 'ab/i18n-scripts' into next
Junio C Hamano [Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)] 
Merge branch 'ab/i18n-scripts' into next

* ab/i18n-scripts: (48 commits)
  i18n: git-bisect bisect_next_check "You need to" message
  i18n: git-bisect [Y/n] messages
  i18n: git-bisect bisect_replay + $1 messages
  i18n: git-bisect bisect_reset + $1 messages
  i18n: git-bisect bisect_run + $@ messages
  i18n: git-bisect die + eval_gettext messages
  i18n: git-bisect die + gettext messages
  i18n: git-bisect echo + eval_gettext message
  i18n: git-bisect echo + gettext messages
  i18n: git-bisect gettext + echo message
  i18n: git-bisect add git-sh-i18n
  i18n: git-stash drop_stash say/die messages
  i18n: git-stash "unknown option" message
  i18n: git-stash die + eval_gettext $1 messages
  i18n: git-stash die + eval_gettext $* messages
  i18n: git-stash die + eval_gettext messages
  i18n: git-stash die + gettext messages
  i18n: git-stash say + gettext messages
  i18n: git-stash echo + gettext message
  i18n: git-stash add git-sh-i18n
  ...

13 years agoMerge branch 'ef/maint-win-verify-path'
Junio C Hamano [Thu, 30 Jun 2011 00:09:17 +0000 (17:09 -0700)] 
Merge branch 'ef/maint-win-verify-path'

* ef/maint-win-verify-path:
  verify_dotfile(): do not assume '/' is the path seperator
  verify_path(): simplify check at the directory boundary
  verify_path: consider dos drive prefix
  real_path: do not assume '/' is the path seperator
  A Windows path starting with a backslash is absolute

13 years agoMerge branch 'js/i18n-windows'
Junio C Hamano [Thu, 30 Jun 2011 00:03:13 +0000 (17:03 -0700)] 
Merge branch 'js/i18n-windows'

* js/i18n-windows:
  Windows: teach getenv to do a case-sensitive search
  mingw.c: move definition of mingw_getenv down
  sh-i18n--envsubst: do not crash when no arguments are given

13 years agoMerge branch 'rs/grep-color'
Junio C Hamano [Thu, 30 Jun 2011 00:03:13 +0000 (17:03 -0700)] 
Merge branch 'rs/grep-color'

* rs/grep-color:
  grep: add --heading
  grep: add --break
  grep: fix coloring of hunk marks between files

13 years agoMerge branch 'jc/maint-1.7.3-checkout-describe'
Junio C Hamano [Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)] 
Merge branch 'jc/maint-1.7.3-checkout-describe'

* jc/maint-1.7.3-checkout-describe:
  checkout -b <name>: correctly detect existing branch

13 years agoMerge branch 'db/http-cookies'
Junio C Hamano [Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)] 
Merge branch 'db/http-cookies'

* db/http-cookies:
  http: pass http.cookiefile using CURLOPT_COOKIEFILE

13 years agoMerge branch 'jk/maint-1.7.2-status-ignored'
Junio C Hamano [Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)] 
Merge branch 'jk/maint-1.7.2-status-ignored'

* jk/maint-1.7.2-status-ignored:
  git status --ignored: tests and docs
  status: fix bug with missing --ignore files

Conflicts:
Documentation/git-status.txt
t/t7508-status.sh

13 years agoMerge branch 'jc/diff-index-quick-exit-early'
Junio C Hamano [Thu, 30 Jun 2011 00:03:11 +0000 (17:03 -0700)] 
Merge branch 'jc/diff-index-quick-exit-early'

* jc/diff-index-quick-exit-early:
  diff-index --quiet: learn the "stop feeding the backend early" logic

Conflicts:
unpack-trees.h

13 years agoMerge branch 'mg/diff-stat-count'
Junio C Hamano [Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)] 
Merge branch 'mg/diff-stat-count'

* mg/diff-stat-count:
  diff --stat-count: finishing touches
  diff-options.txt: describe --stat-{width,name-width,count}
  diff: introduce --stat-lines to limit the stat lines
  diff.c: omit hidden entries from namelen calculation with --stat

13 years agoMerge branch 'jc/advice-about-to-lose-commit'
Junio C Hamano [Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)] 
Merge branch 'jc/advice-about-to-lose-commit'

* jc/advice-about-to-lose-commit:
  checkout: make advice when reattaching the HEAD less loud

Conflicts:
builtin/checkout.c

13 years agoMerge branch 'jk/combine-diff-binary-etc'
Junio C Hamano [Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)] 
Merge branch 'jk/combine-diff-binary-etc'

* jk/combine-diff-binary-etc:
  combine-diff: respect textconv attributes
  refactor get_textconv to not require diff_filespec
  combine-diff: handle binary files as binary
  combine-diff: calculate mode_differs earlier
  combine-diff: split header printing into its own function

13 years agoMerge branch 'instaweb' of git://bogomips.org/git-svn
Junio C Hamano [Wed, 29 Jun 2011 23:43:23 +0000 (16:43 -0700)] 
Merge branch 'instaweb' of git://bogomips.org/git-svn

* 'instaweb' of git://bogomips.org/git-svn:
  git-instaweb: Check that correct config file exists for (re)start
  git-instaweb: Move all actions at the end of script
  git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf
  git-instaweb: Extract configuring web server into configure_httpd

13 years agoMerge git://bogomips.org/git-svn into maint
Junio C Hamano [Wed, 29 Jun 2011 23:42:41 +0000 (16:42 -0700)] 
Merge git://bogomips.org/git-svn into maint

* git://bogomips.org/git-svn:
  git-svn: Correctly handle root commits in mergeinfo ranges
  git-svn: Disambiguate rev-list arguments to improve error message
  git-svn: Demonstrate a bug with root commits in mergeinfo ranges

13 years agoMerge branch 'maint-1.7.5' into maint
Junio C Hamano [Wed, 29 Jun 2011 23:41:55 +0000 (16:41 -0700)] 
Merge branch 'maint-1.7.5' into maint

* maint-1.7.5:
  test: skip clean-up when running under --immediate mode
  "branch -d" can remove more than one branches

13 years agotest: skip clean-up when running under --immediate mode
Junio C Hamano [Mon, 27 Jun 2011 18:02:22 +0000 (11:02 -0700)] 
test: skip clean-up when running under --immediate mode

Some tests try to be too careful about cleaning themselves up and
do

    test_expect_success description '
        set-up some test refs and/or configuration &&
        test_when_finished "revert the above changes" &&
the real test
    '

Which is nice to make sure that a potential failure would not have
unexpected interaction with the next test. This however interferes when
"the real test" fails and we want to see what is going on, by running the
test with --immediate mode and descending into its trash directory after
the test stops. The precondition to run the real test and cause it to fail
is all gone after the clean-up procedure defined by test_when_finished is
done.

Update test_run_ which is the workhorse of running a test script
called from test_expect_success and test_expect_failure, so that we do not
run clean-up script defined with test_when_finished when a test that is
expected to succeed fails under the --immediate mode.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Jeff King <peff@peff.net>
13 years ago"branch -d" can remove more than one branches
Junio C Hamano [Mon, 27 Jun 2011 22:04:32 +0000 (15:04 -0700)] 
"branch -d" can remove more than one branches

Since 03feddd (git-check-ref-format: reject funny ref names, 2005-10-13),
"git branch -d" can take more than one branch names to remove.

The documentation was correct, but the usage string was not.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: do not print lots of usage hints after an obvious error message
Johannes Sixt [Tue, 28 Jun 2011 12:46:14 +0000 (14:46 +0200)] 
rebase: do not print lots of usage hints after an obvious error message

When a non-existent branch was specified to be rebased, the complete
usage information is printed after the error message that carries the
relevant piece of information:

   $ git rebase master topci
   fatal: no such branch: topci
   usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
      or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
      or: git-rebase [-i] --continue | --abort | --skip

   Available options are
   [30 lines of usage stripped]

The error message was introduced recently by 4ac5356c (rebase: give a
better error message for bogus branch, 2011-01-27), and the result was
acceptable because the usage text was just two lines. But 45e2acf3
(rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse
because the usage text is now 35 lines.

Just drop the usage information because it does not add value to the
error message.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/i18n: quote double-dash for AsciiDoc
Jonathan Nieder [Wed, 29 Jun 2011 05:36:48 +0000 (00:36 -0500)] 
Documentation/i18n: quote double-dash for AsciiDoc

As explained in v1.7.3-rc0~13^2 (Work around em-dash handling in newer
AsciiDoc, 2010-08-23), if double dashes in names of commands are not
escaped, AsciiDoc renders them as em dashes.

While fixing that, spell the command name as "git sh-i18n--envsubst"
(2 words) instead of emphasizing the name of the binary (one
hyphenated name) and format it in italics.

The double-dash in the title should be escaped, too, to avoid spurious
em dashes in the header:

  .TH "GIT\-SH\-I18N\(emENVSUB" "1" "06/26/2011" "Git 1\&.7\&.6" "Git Manual"

AsciiDoc 8.6.4 with DocBook XSL 1.76.0-RC1 copes fine and writes
"GIT\-SH\-I18N\-\-ENVSUB" even without this change, which is why it
was missed before.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jn/maint-doc-dashdash' into jn/doc-dashdash
Junio C Hamano [Wed, 29 Jun 2011 16:25:51 +0000 (09:25 -0700)] 
Merge branch 'jn/maint-doc-dashdash' into jn/doc-dashdash

* jn/maint-doc-dashdash:
  Documentation: quote double-dash for AsciiDoc

13 years agoDocumentation: quote double-dash for AsciiDoc
Jonathan Nieder [Wed, 29 Jun 2011 05:35:10 +0000 (00:35 -0500)] 
Documentation: quote double-dash for AsciiDoc

AsciiDoc versions since 5.0.6 treat a double-dash surrounded by spaces
(outside of verbatim environments) as a request to insert an em dash.
Such versions also treat the three-character sequence "\--", when not
followed by another dash, as a request to insert two literal minus
signs.  Thus from time to time there have been patches to add
backslashes to AsciiDoc markup to escape double-dashes that are meant
to be represent '--' characters used literally on the command line;
see v1.4.0-rc1~174, Fix up docs where "--" isn't displayed correctly,
2006-05-05, for example.

AsciiDoc 6.0.3 (2005-04-20) made life harder by also treating
double-dashes without surrounding whitespace as markup for an em dash,
though only when formatting for backends other than the manpages
(e.g., HTML).  Many pages needed to be changed to use a backslash
before the "--" in names of command-line flags like "--add" (see
v0.99.6~37, Update tutorial, 2005-08-30).

AsciiDoc 8.3.0 (2008-11-29) refined the em-dash rule to avoid that
requirement.  Double-dashes without surrounding spaces are not
rendered as em dashes any more unless bordered on both sides by
alphanumeric characters.  The unescaped markup for option names (e.g.,
"--add") works fine, and many instances of this style have leaked into
Documentation/; git's HTML documentation contains many spurious em
dashes when formatted by an older toolchain.  (This patch will not
change that.)

The upshot: "--" as an isolated word and in phrases like "git
web--browse" must be escaped if it is not to be rendered as an em dash
by current asciidoc.  Use "\--" to avoid such misformatting in
sentences in which "--" represents a literal double-minus command line
argument that separates options and revs from pathspecs, and use
"{litdd}" in cases where the double-dash is embedded in the command
name.  The latter is just for consistency with v1.7.3-rc0~13^2 (Work
around em-dash handling in newer AsciiDoc, 2010-08-23).

List of lines to fix found by grepping manpages for "(em".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-svn: Correctly handle root commits in mergeinfo ranges
Michael Haggerty [Sat, 18 Jun 2011 06:48:00 +0000 (08:48 +0200)] 
git-svn: Correctly handle root commits in mergeinfo ranges

If the bottom of a mergeinfo range is a commit that maps to a git root
commit, then it doesn't have a parent.  In such a case, use git commit
range "$top_commit" rather than "$bottom_commit^..$top_commit".

[ew: line-wrap at 80 columns]

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-svn: Disambiguate rev-list arguments to improve error message
Michael Haggerty [Sat, 18 Jun 2011 06:47:59 +0000 (08:47 +0200)] 
git-svn: Disambiguate rev-list arguments to improve error message

Add "--" in the "git rev-list" command line so that if there is a bug
and the revisions cannot be found, the error message is a bit less
cryptic.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-svn: Demonstrate a bug with root commits in mergeinfo ranges
Michael Haggerty [Sat, 18 Jun 2011 06:47:58 +0000 (08:47 +0200)] 
git-svn: Demonstrate a bug with root commits in mergeinfo ranges

If a svn:mergeinfo range starts at a commit that was converted as a
git root commit (e.g., r1 or a branch that was created out of thin
air), then there is an error when git-svn tries to run

    git rev-list "$bottom_commit^..$top_commit"

because $bottom_commit (the git commit corresponding to r1) has no
parent.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-instaweb: Check that correct config file exists for (re)start
Jakub Narebski [Thu, 23 Jun 2011 21:01:03 +0000 (23:01 +0200)] 
git-instaweb: Check that correct config file exists for (re)start

Currently start/restart does not generate any configuration files for
spawning a new instance.  This means that

  $ git instaweb --http=<server> --start

might pick up stale 'httpd.conf' file for a different web server
(e.g. for default lighttpd when requesting apache2).

This commit changes that, and makes git-instaweb generate web server
config file and/or gitweb config file if don't exists.

This required naming config files after the name of web server
(alternate solution would be to somehow mark for which web server was
config file generated).

Note that web servers that embed configuration in server script file,
namely webrick and plackup, and which delete "$conf" in their *_conf
function, would have their config (server script) always regenerated.

Note: this commit introduces a bit of code repetition (but only a few
lines).

Reported-by: Gurjeet Singh <singh.gurjeet@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-instaweb: Move all actions at the end of script
Jakub Narebski [Thu, 23 Jun 2011 20:59:26 +0000 (22:59 +0200)] 
git-instaweb: Move all actions at the end of script

As a nice side-effect now the order of parameters does not matter:

  $ git instaweb --httpd=apache2 --start

is now (after this patch) the same as

  $ git instaweb --start --httpd=apache2

Before this commit --start, --stop, --restart (and their subcommand
versions start, stop, restart) exited immediately.

This is preparatory work for making start/restart check that correct
configuration is set up; this change was required to have access in
start_httpd to requested web browser etc.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf
Jakub Narebski [Thu, 23 Jun 2011 19:56:37 +0000 (21:56 +0200)] 
git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf

Don't repeat yourself: use "$conf" instead of its [current] contents,
namely "$fqgitdir/gitweb/httpd.conf".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agogit-instaweb: Extract configuring web server into configure_httpd
Jakub Narebski [Thu, 23 Jun 2011 19:55:00 +0000 (21:55 +0200)] 
git-instaweb: Extract configuring web server into configure_httpd

This is preparatory work for making start/restart check that
git-instaweb set up correct configuration, and generate it if it is
missing.

Pure refactoring, no functional changes.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
13 years agosubmodule add: always initialize .git/config entry
Jens Lehmann [Sat, 25 Jun 2011 23:26:02 +0000 (01:26 +0200)] 
submodule add: always initialize .git/config entry

When "git submodule add $path" is run to add a subdirectory $path to the
superproject, and $path is already the top of the working tree of the
submodule repository, the command created submodule.$path.url entry in the
configuration file in the superproject. However, when adding a repository
$URL that is outside the respository of the superproject to $path that
does not exist (yet) with "git submodule add $URL $path", the command
forgot to set it up.

The user is expressing the interest in the submodule and wants to keep a
checkout, the "submodule add" command should consistently set up the
submodule.$path.url entry in either case.

As a result "git submodule init" can't simply skip the initialization of
those submodules for which it finds an url entry in the git./config
anymore. That lead to problems when adding a submodule (which now sets the
url), add the "update" setting to .gitmodules and expect init to copy that
into .git/config like it is done in t7406. So change init to only then
copy the "url" and "update" entries when they don't exist yet in the
.git/config and do nothing otherwise.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosubmodule sync: do not auto-vivify uninteresting submodule
Junio C Hamano [Sat, 25 Jun 2011 20:41:25 +0000 (22:41 +0200)] 
submodule sync: do not auto-vivify uninteresting submodule

Earlier 33f072f (submodule sync: Update "submodule.<name>.url" for empty
directories, 2010-10-08) attempted to fix a bug where "git submodule sync"
command does not update the URL if the current superproject does not have
a checkout of the submodule.

However, it did so by unconditionally registering submodule.$name.url to
every submodule in the project, even the ones that the user has never
showed interest in at all by running 'git submodule init' command. This
caused subsequent 'git submodule update' to start cloning/updating submodules
that are not interesting to the user at all.

Update the code so that the URL is updated from the .gitmodules file only
for submodules that already have submodule.$name.url entries, i.e. the
ones the user has showed interested in having a checkout.

Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.6 v1.7.6
Junio C Hamano [Sun, 26 Jun 2011 19:41:16 +0000 (12:41 -0700)] 
Git 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Sun, 26 Jun 2011 19:09:11 +0000 (12:09 -0700)] 
Merge branch 'maint'

* maint:
  completion: replace core.abbrevguard to core.abbrev

13 years agoMerge branch 'maint-1.7.4' into maint
Junio C Hamano [Fri, 24 Jun 2011 16:40:02 +0000 (09:40 -0700)] 
Merge branch 'maint-1.7.4' into maint

* maint-1.7.4:
  completion: replace core.abbrevguard to core.abbrev

13 years agocompletion: replace core.abbrevguard to core.abbrev
Namhyung Kim [Fri, 24 Jun 2011 06:17:42 +0000 (15:17 +0900)] 
completion: replace core.abbrevguard to core.abbrev

The core.abbrevguard config variable had removed and
now core.abbrev has been used instead. Teach it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoglossary: clarify description of HEAD
Junio C Hamano [Thu, 23 Jun 2011 16:48:49 +0000 (09:48 -0700)] 
glossary: clarify description of HEAD

HEAD on a branch does reference a commit via the branch ref it refers to.
The main difference of a detached HEAD is that it _directly_ refers to
a commit.  Clarify this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoglossary: update description of head and ref
Junio C Hamano [Thu, 23 Jun 2011 16:47:28 +0000 (09:47 -0700)] 
glossary: update description of head and ref

Reword them to avoid sounding as if loose refs are the only ones in the world.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoglossary: update description of "tag"
Junio C Hamano [Thu, 23 Jun 2011 16:38:48 +0000 (09:38 -0700)] 
glossary: update description of "tag"

It is an unimportant implementation detail that ref namespaces are
implemented as subdirectories of $GIT_DIR/refs. What is more important
is that tags are in refs/tags hierarchy in the ref namespace.

Also note that a tag can point at an object of arbitrary type, not limited
to commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit.txt: de-emphasize the implementation detail of a ref
Junio C Hamano [Thu, 23 Jun 2011 16:35:10 +0000 (09:35 -0700)] 
git.txt: de-emphasize the implementation detail of a ref

It is an unimportant implementation detail that branches and tags are
stored somewhere under $GIT_DIR/refs directory, or the name of the commit
that will become the parent of the next commit is stored in $GIT_DIR/HEAD.

What is more important is that branches live in refs/heads and tags live
in refs/tags hierarchy in the ref namespace, and HEAD means the tip of the
current branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheck-ref-format doc: de-emphasize the implementation detail of a ref
Junio C Hamano [Thu, 23 Jun 2011 16:31:19 +0000 (09:31 -0700)] 
check-ref-format doc: de-emphasize the implementation detail of a ref

It is an unimportant implementation detail that branches and tags are
stored somewhere under $GIT_DIR/refs directory. What is more important
is that branches live in refs/heads and tags live in refs/tags hierarchy
in the ref namespace.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-remote.txt: avoid sounding as if loose refs are the only ones in the world
Junio C Hamano [Thu, 23 Jun 2011 15:33:05 +0000 (08:33 -0700)] 
git-remote.txt: avoid sounding as if loose refs are the only ones in the world

It was correct to say "The file $GIT_DIR/refs/heads/master stores the
commit object name at the tip of the master branch" in the older days,
but not anymore, as refs can be packed into $GIT_DIR/packed-refs file.

Update the document to talk in terms of a more abstract concept "ref" and
"symbolic ref" where we are not describing the underlying implementation
detail.

This on purpose leaves two instances of $GIT_DIR/ in the git-remote
documentation; they do talk about $GIT_DIR/remotes/ and $GIT_DIR/branches/
file hierarchy that used to be the place to store configuration around
remotes before the configuration mechanism took them over.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-remote.txt: fix wrong remote refspec
Namhyung Kim [Thu, 23 Jun 2011 08:12:04 +0000 (17:12 +0900)] 
git-remote.txt: fix wrong remote refspec

$GIT_DIR/remotes/<name>/<branch> should be
$GIT_DIR/refs/remotes/<name>/<branch>.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.6-rc3 v1.7.6-rc3
Junio C Hamano [Wed, 22 Jun 2011 23:13:16 +0000 (16:13 -0700)] 
Git 1.7.6-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Wed, 22 Jun 2011 21:01:18 +0000 (14:01 -0700)] 
Merge branch 'maint'

* maint:
  Documentation: git diff --check respects core.whitespace

13 years agoMakefile: Track changes to LDFLAGS and relink when necessary
Fredrik Kuivinen [Wed, 22 Jun 2011 10:50:56 +0000 (12:50 +0200)] 
Makefile: Track changes to LDFLAGS and relink when necessary

Some profiling tools (e.g., google-perftools and mutrace) work by
linking in a new library into the executables. When using these tools
it is convenient to only relink instead of doing a full make clean;
make cycle.

This change complements the auto-detection of changes to CFLAGS that
we already have. Tracking of more variables that affect the build can
be added when the need arise.

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: git diff --check respects core.whitespace
Christof Krüger [Wed, 22 Jun 2011 15:33:02 +0000 (17:33 +0200)] 
Documentation: git diff --check respects core.whitespace

Fix documentation on "git diff --check" by adopting the description from
"git apply --whitespace".

Signed-off-by: Christof Krüger <git@christof-krueger.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig: use strbuf_split_str instead of a temporary strbuf
Jeff King [Thu, 9 Jun 2011 15:55:09 +0000 (11:55 -0400)] 
config: use strbuf_split_str instead of a temporary strbuf

This saves an allocation and copy, and also fixes a minor
memory leak.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostrbuf: allow strbuf_split to work on non-strbufs
Jeff King [Thu, 9 Jun 2011 15:54:58 +0000 (11:54 -0400)] 
strbuf: allow strbuf_split to work on non-strbufs

The strbuf_split function takes a strbuf as input, and
outputs a list of strbufs. However, there is no reason that
the input has to be a strbuf, and not an arbitrary buffer.

This patch adds strbuf_split_buf for a length-delimited
buffer, and strbuf_split_str for NUL-terminated strings.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig: avoid segfault when parsing command-line config
Jeff King [Thu, 9 Jun 2011 15:52:43 +0000 (11:52 -0400)] 
config: avoid segfault when parsing command-line config

We already check for an empty key on the left side of an
equals, but we would segfault if there was no content at
all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig: die on error in command-line config
Jeff King [Thu, 9 Jun 2011 15:52:32 +0000 (11:52 -0400)] 
config: die on error in command-line config

The error handling for git_config is somewhat confusing. We
collect errors from running git_config_from_file on the
various config files and carefully pass them back up. But
the two odd things are:

  1. We actually die on most errors in git_config_from_file.
     In fact, the only error we actually pass back up is if
     fopen() fails on the file.

  2. Most callers of git_config do not check the error
     return at all, but will continue if git_config reports
     an error.

When the code for "git -c core.foo=bar" was added, it
dutifully passed errors up the call stack, only for them to
be eventually ignored. This makes it inconsistent with the
file-parsing code, which will die when it sees malformed
config. And it's somewhat unsafe, because it means an error
in parsing a typo like:

  git -c clean.requireforce=ture clean

will continue the command, ignoring the config the user
tried to give.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofix "git -c" parsing of values with equals signs
Jeff King [Thu, 9 Jun 2011 15:51:36 +0000 (11:51 -0400)] 
fix "git -c" parsing of values with equals signs

If you do something like:

  git -c core.foo="value with = in it" ...

we would split your option on "=" into three fields and
throw away the third one. With this patch we correctly take
everything after the first "=" as the value (keys cannot
have an equals sign in them, so the parsing is unambiguous).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostrbuf_split: add a max parameter
Jeff King [Thu, 9 Jun 2011 15:51:22 +0000 (11:51 -0400)] 
strbuf_split: add a max parameter

Sometimes when splitting, you only want a limited number of
fields, and for the final field to contain "everything
else", even if it includes the delimiter.

This patch introduces strbuf_split_max, which provides a
"max number of fields" parameter; it behaves similarly to
perl's "split" with a 3rd field.

The existing 2-argument form of strbuf_split is retained for
compatibility and ease-of-use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 21 Jun 2011 21:56:59 +0000 (14:56 -0700)] 
Merge branch 'maint'

* maint:
  gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled

13 years agogitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled
Jakub Narebski [Tue, 21 Jun 2011 06:41:16 +0000 (08:41 +0200)] 
gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled

Both 'pickaxe' (searching changes) and 'grep' (searching files)
require basic 'search' feature to be enabled to work.  Enabling
e.g. only 'pickaxe' won't work.

Add a comment about this.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd explanation of the profile feedback build to the README
Andi Kleen [Mon, 20 Jun 2011 22:41:01 +0000 (15:41 -0700)] 
Add explanation of the profile feedback build to the README

Also explains that the are additional warnings.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mk/grep-pcre'
Junio C Hamano [Mon, 20 Jun 2011 21:49:44 +0000 (14:49 -0700)] 
Merge branch 'mk/grep-pcre'

* mk/grep-pcre:
  t7810: avoid unportable use of "echo"

13 years agot7810: avoid unportable use of "echo"
Junio C Hamano [Mon, 20 Jun 2011 21:49:34 +0000 (14:49 -0700)] 
t7810: avoid unportable use of "echo"

Michael J Gruber noticed that under /bin/dash this test failed
(as is expected -- \n in the string can be interpreted by the
command), while it passed with bash.  We probably could work it
around by using backquote in front of it, but it is safer and
more readable to avoid "echo" altogether in a case like this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoplug a few coverity-spotted leaks
Jim Meyering [Mon, 20 Jun 2011 07:40:06 +0000 (09:40 +0200)] 
plug a few coverity-spotted leaks

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd profile feedback build to git
Andi Kleen [Sun, 19 Jun 2011 01:07:05 +0000 (18:07 -0700)] 
Add profile feedback build to git

Add a gcc profile feedback build option "profile-all" to the main
Makefile. It simply runs the test suite to generate feedback data and the
recompiles the main executables with that. The basic structure is similar
to the existing gcov code.

gcc is often able to generate better code with profile feedback data. The
training load also doesn't need to be too similar to the actual load, it
still gives benefits.

The test suite run is unfortunately quite long. It would be good to find a
suitable subset that runs faster and still gives reasonable feedback.

For now the test suite runs single threaded (I had some trouble running
the test suite with -jX)

I tested it with git gc and git blame kernel/sched.c on a Linux kernel
tree. For gc I get about 2.7% improvement in wall clock time by using the
feedback build, for blame about 2.4%.  That's not gigantic, but not shabby
either for a very small patch.

If anyone has any favourite CPU intensive git benchmarks feel free to try
them too.

I hope distributors will switch to use a feedback build in their packages.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocygwin: trust executable bit by default
Junio C Hamano [Mon, 20 Jun 2011 19:31:59 +0000 (12:31 -0700)] 
cygwin: trust executable bit by default

Earlier 7974843 (compat/cygwin.c: make runtime detection of lstat/stat
lessor impact, 2008-10-23) fixed the low-level "do we use cygwin specific
hacks for stat/lstat?" logic not to call into git_default_config() from
random codepaths that are typically very late in the program, to prevent
the call from potentially overwriting other variables that are initialized
from the configuration.

However, it forgot that on Cygwin, trust-executable-bit should default to
true.

Noticed by J6t, confirmed by Ramsay Jones, and the brown paper bag is on
Gitster's head.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: Also fetch submodules in subdirectories in on-demand mode
Jens Lehmann [Mon, 20 Jun 2011 18:18:03 +0000 (20:18 +0200)] 
fetch: Also fetch submodules in subdirectories in on-demand mode

When on-demand mode was active examining the new commits just fetched in
the superproject (to check if they record commits for submodules which are
not downloaded yet) wasn't done recursively. Because of that fetch did not
recursively fetch submodules living in subdirectories even when it should
have.

Fix that by adding the RECURSIVE flag to the diff_options used to check
the new commits and avoid future regressions in this area by moving a
submodule in t5526 into a subdirectory.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotag: accept multiple patterns for --list
Jeff King [Mon, 20 Jun 2011 16:59:28 +0000 (12:59 -0400)] 
tag: accept multiple patterns for --list

Until now, "git tag -l foo* bar*" would silently ignore the
second argument, showing only refs starting with "foo". It's
not just unfriendly not to take a second pattern; we
actually generated subtly wrong results (from the user's
perspective) because some of the requested tags were
omitted.

This patch allows an arbitrary number of patterns on the
command line; if any of them matches, the ref is shown.

While we're tweaking the documentation, let's also make it
clear that the pattern is fnmatch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd option to disable NORETURN
Junio C Hamano [Sun, 19 Jun 2011 01:07:03 +0000 (18:07 -0700)] 
Add option to disable NORETURN

Due to a bug in gcc 4.6+ it can crash when doing profile feedback
with a noreturn function pointer

(http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49299)

This adds a Makefile variable to disable noreturns.

[Patch by Junio, description by Andi Kleen]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'di/no-no-existant'
Junio C Hamano [Sun, 19 Jun 2011 23:01:54 +0000 (16:01 -0700)] 
Merge branch 'di/no-no-existant'

* di/no-no-existant:
  Fix typo: existant->existent

13 years agoMerge branch 'maint'
Junio C Hamano [Sun, 19 Jun 2011 23:01:51 +0000 (16:01 -0700)] 
Merge branch 'maint'

* maint:
  builtin/gc.c: add missing newline in message

13 years agobuiltin/gc.c: add missing newline in message
Andreas Schwab [Sun, 19 Jun 2011 08:03:26 +0000 (10:03 +0200)] 
builtin/gc.c: add missing newline in message

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase -i -p: include non-first-parent commits in todo list
Andrew Wong [Sat, 18 Jun 2011 22:12:01 +0000 (18:12 -0400)] 
rebase -i -p: include non-first-parent commits in todo list

Consider this graph:

        D---E    (topic, HEAD)
       /   /
  A---B---C      (master)
   \
    F            (topic2)

and the following three commands:
  1. git rebase -i -p A
  2. git rebase -i -p --onto F A
  3. git rebase -i -p B

Currently, (1) and (2) will pick B, D, C, and E onto A and F,
respectively.  However, (3) will only pick D and E onto B, but not C,
which is inconsistent with (1) and (2).  As a result, we cannot modify C
during the interactive-rebase.

The current behavior also creates a bug if we do:
  4. git rebase -i -p C

In (4), E is never picked.  And since interactive-rebase resets "HEAD"
to "onto" before picking any commits, D and E are lost after the
interactive-rebase.

This patch fixes the inconsistency and bug by ensuring that all children
of upstream are always picked.  This essentially reverts the commit:
  d80d6bc146232d81f1bb4bc58e5d89263fd228d4

When compiling the todo list, commits reachable from "upstream" should
never be skipped under any conditions.  Otherwise, we lose the ability
to modify them like (3), and create a bug like (4).

Two of the tests contain a scenario like (3).  Since the new behavior
added more commits for picking, these tests need to be updated to
account for the additional pick lines.  A new test has also been added
for (4).

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: link shell libraries into valgrind directory
Jeff King [Fri, 17 Jun 2011 20:36:32 +0000 (16:36 -0400)] 
tests: link shell libraries into valgrind directory

When we run tests under valgrind, we symlink anything
executable that starts with git-* or test-* into a special
valgrind bin directory, and then make that our
GIT_EXEC_PATH.

However, shell libraries like git-sh-setup do not have the
executable bit marked, and did not get symlinked.  This
means that any test looking for shell libraries in our
exec-path would fail to find them, even though that is a
fine thing to do when testing against a regular git build
(or in a git install, for that matter).

t2300 demonstrated this problem. The fix is to symlink these
shell libraries directly into the valgrind directory.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/Makefile: pass test opts to valgrind target properly
Jeff King [Fri, 17 Jun 2011 08:29:57 +0000 (04:29 -0400)] 
t/Makefile: pass test opts to valgrind target properly

The valgrind target just reinvokes make with GIT_TEST_OPTS
set to "--valgrind". However, it does this using an
environment variable, which means GIT_TEST_OPTS in your
config.mak would override it, and "make valgrind" would
simply run the test suite without valgrind on.

Instead, we should pass GIT_TEST_OPTS on the command-line,
overriding what's in config.mak, and take care to append to
whatever the user has there already.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'ab/i18n-scripts-basic'
Junio C Hamano [Fri, 17 Jun 2011 18:40:32 +0000 (11:40 -0700)] 
Merge branch 'ab/i18n-scripts-basic'

* ab/i18n-scripts-basic:
  sh-i18n--envsubst.c: do not #include getopt.h

13 years agosh-i18n--envsubst.c: do not #include getopt.h
Brandon Casey [Fri, 17 Jun 2011 18:19:26 +0000 (11:19 -0700)] 
sh-i18n--envsubst.c: do not #include getopt.h

The getopt.h header file is not used.  It's inclusion is left over from the
original version of this source.  Additionally, getopt.h does not exist on
all platforms (SunOS 5.7) and will cause a compilation failure.  So, let's
remove it.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig.c: Make git_config() work correctly when called recursively
Ramsay Jones [Thu, 16 Jun 2011 20:24:51 +0000 (21:24 +0100)] 
config.c: Make git_config() work correctly when called recursively

On Cygwin, this fixes a test failure in t3301-notes.sh (test 98,
"git notes copy --for-rewrite (disabled)").

The test failure is caused by a recursive call to git_config() which
has the effect of skipping to the end-of-file while processing the
"notes.rewriteref" config variable. Thus, any config variables that
appear after "notes.rewriteref" are simply ignored by git_config().
Also, we note that the original FILE handle is leaked as a result
of the recursive call.

The recursive call to git_config() is due to the "schizophrenic stat"
functions on cygwin, where one of two different implementations of
the l/stat functions is selected lazily, depending on some config
variables.

In this case, the init_copy_notes_for_rewrite() function calls
git_config() with the notes_rewrite_config() callback function.
This callback, while processing the "notes.rewriteref" variable,
in turn calls string_list_add_refs_by_glob() to process the
associated ref value. This eventually leads to a call to the
get_ref_dir() function, which in turn calls stat(). On cygwin,
the stat() macro leads to an indirect call to cygwin_stat_stub()
which, via init_stat(), then calls git_config() in order to
determine which l/stat implementation to bind to.

In order to solve this problem, we modify git_config() so that the
global state variables used by the config reading code is packaged
up and managed on a local state stack.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot1301-*.sh: Fix the 'forced modes' test on cygwin
Ramsay Jones [Thu, 16 Jun 2011 20:23:14 +0000 (21:23 +0100)] 
t1301-*.sh: Fix the 'forced modes' test on cygwin

The 'forced modes' test fails on cygwin because the post-update
hook loses it's executable bit when copied from the templates
directory by git-init. The template loses it's executable bit
because the lstat() function resolves to the "native Win32 API"
implementation.

This call to lstat() happens after git-init has set the "git_dir"
(so has_git_dir() returns true), but before the configuration has
been fully initialised. At this point git_config() does not find
any config files to parse and returns 0. Unfortunately, the code
used to determine the cygwin l/stat() function bindings did not
check the return from git_config() and assumed that the config
was complete and accessible once "git_dir" was set.

In order to fix the test, we simply change the binding code to
test the return value from git_config(), to ensure that it actually
had config values to read, before determining the requested binding.

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