Code

git.git
13 years agoMerge branch 'ma/am-exclude'
Junio C Hamano [Fri, 19 Aug 2011 05:07:54 +0000 (22:07 -0700)]
Merge branch 'ma/am-exclude'

* ma/am-exclude:
  am: Document new --exclude=<path> option
  am: pass exclude down to apply

13 years agoMerge branch 'maint'
Junio C Hamano [Fri, 19 Aug 2011 05:06:03 +0000 (22:06 -0700)]
Merge branch 'maint'

* maint:
  fetch-pack: check for valid commit from server

13 years agofetch-pack: check for valid commit from server
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 13:36:03 +0000 (20:36 +0700)]
fetch-pack: check for valid commit from server

A malicious server can return ACK with non-existent SHA-1 or not a
commit. lookup_commit() in this case may return NULL. Do not let
fetch-pack crash by accessing NULL address in this case.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.7
Junio C Hamano [Thu, 18 Aug 2011 00:48:36 +0000 (17:48 -0700)]
Update draft release notes to 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mh/check-attr-relative'
Junio C Hamano [Thu, 18 Aug 2011 00:36:22 +0000 (17:36 -0700)]
Merge branch 'mh/check-attr-relative'

* mh/check-attr-relative: (29 commits)
  test-path-utils: Add subcommand "prefix_path"
  test-path-utils: Add subcommand "absolute_path"
  git-check-attr: Normalize paths
  git-check-attr: Demonstrate problems with relative paths
  git-check-attr: Demonstrate problems with unnormalized paths
  git-check-attr: test that no output is written to stderr
  Rename git_checkattr() to git_check_attr()
  git-check-attr: Fix command-line handling to match docs
  git-check-attr: Drive two tests using the same raw data
  git-check-attr: Add an --all option to show all attributes
  git-check-attr: Error out if no pathnames are specified
  git-check-attr: Process command-line args more systematically
  git-check-attr: Handle each error separately
  git-check-attr: Extract a function error_with_usage()
  git-check-attr: Introduce a new variable
  git-check-attr: Extract a function output_attr()
  Allow querying all attributes on a file
  Remove redundant check
  Remove redundant call to bootstrap_attr_stack()
  Extract a function collect_all_attrs()
  ...

13 years agoMerge branch 'js/bisect-no-checkout'
Junio C Hamano [Thu, 18 Aug 2011 00:36:09 +0000 (17:36 -0700)]
Merge branch 'js/bisect-no-checkout'

* js/bisect-no-checkout:
  bisect: add support for bisecting bare repositories
  bisect: further style nitpicks
  bisect: replace "; then" with "\n<tab>*then"
  bisect: cleanup whitespace errors in git-bisect.sh.
  bisect: add documentation for --no-checkout option.
  bisect: add tests for the --no-checkout option.
  bisect: introduce --no-checkout support into porcelain.
  bisect: introduce support for --no-checkout option.
  bisect: add tests to document expected behaviour in presence of broken trees.
  bisect: use && to connect statements that are deferred with eval.
  bisect: move argument parsing before state modification.

13 years agoMerge branch 'rc/histogram-diff'
Junio C Hamano [Thu, 18 Aug 2011 00:36:06 +0000 (17:36 -0700)]
Merge branch 'rc/histogram-diff'

* rc/histogram-diff:
  xdiff/xhistogram: drop need for additional variable
  xdiff/xhistogram: rely on xdl_trim_ends()
  xdiff/xhistogram: rework handling of recursed results
  xdiff: do away with xdl_mmfile_next()
  Make test number unique
  xdiff/xprepare: use a smaller sample size for histogram diff
  xdiff/xprepare: skip classification
  teach --histogram to diff
  t4033-diff-patience: factor out tests
  xdiff/xpatience: factor out fall-back-diff function
  xdiff/xprepare: refactor abort cleanups
  xdiff/xprepare: use memset()

13 years agoMerge branch 'jc/maint-smart-http-race-upload-pack'
Junio C Hamano [Thu, 18 Aug 2011 00:35:58 +0000 (17:35 -0700)]
Merge branch 'jc/maint-smart-http-race-upload-pack'

* jc/maint-smart-http-race-upload-pack:
  helping smart-http/stateless-rpc fetch race

13 years agoMerge branch 'js/sh-style'
Junio C Hamano [Thu, 18 Aug 2011 00:35:50 +0000 (17:35 -0700)]
Merge branch 'js/sh-style'

* js/sh-style:
  filter-branch.sh: de-dent usage string
  misc-sh: fix up whitespace in some other .sh files.

13 years agoMerge branch 'js/ref-namespaces'
Junio C Hamano [Thu, 18 Aug 2011 00:35:38 +0000 (17:35 -0700)]
Merge branch 'js/ref-namespaces'

* js/ref-namespaces:
  ref namespaces: tests
  ref namespaces: documentation
  ref namespaces: Support remote repositories via upload-pack and receive-pack
  ref namespaces: infrastructure
  Fix prefix handling in ref iteration functions

13 years agoMerge branch 'cb/maint-quiet-push'
Junio C Hamano [Thu, 18 Aug 2011 00:26:05 +0000 (17:26 -0700)]
Merge branch 'cb/maint-quiet-push'

* cb/maint-quiet-push:
  receive-pack: do not overstep command line argument array
  propagate --quiet to send-pack/receive-pack

Conflicts:
Documentation/git-receive-pack.txt
Documentation/git-send-pack.txt

13 years agoMerge branch 'jc/maint-combined-diff-work-tree'
Junio C Hamano [Thu, 18 Aug 2011 00:25:59 +0000 (17:25 -0700)]
Merge branch 'jc/maint-combined-diff-work-tree'

* jc/maint-combined-diff-work-tree:
  diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"

Conflicts:
combine-diff.c

13 years agoMerge branch 'cb/maint-exec-error-report'
Junio C Hamano [Thu, 18 Aug 2011 00:25:55 +0000 (17:25 -0700)]
Merge branch 'cb/maint-exec-error-report'

* cb/maint-exec-error-report:
  notice error exit from pager
  error_routine: use parent's stderr if exec fails

13 years agoMerge branch 'maint'
Junio C Hamano [Thu, 18 Aug 2011 00:25:37 +0000 (17:25 -0700)]
Merge branch 'maint'

* maint:
  checkout-index: remove obsolete comment

13 years agocheckout-index: remove obsolete comment
Nguyễn Thái Ngọc Duy [Wed, 17 Aug 2011 12:22:13 +0000 (19:22 +0700)]
checkout-index: remove obsolete comment

The first paragraph about flag order is no longer true and is
mentioned in git-checkout-index.txt. The rest is also mentioned in
git-checkout-index.txt.

Remove it and keep uptodate document in one place.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoSync with "maint"
Junio C Hamano [Tue, 16 Aug 2011 21:23:43 +0000 (14:23 -0700)]
Sync with "maint"

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

* maint:
  Prepare for 1.7.6.1
  am: refresh the index at start and --resolved

Conflicts:
GIT-VERSION-GEN
RelNotes

13 years agoPrepare for 1.7.6.1
Junio C Hamano [Tue, 16 Aug 2011 19:13:38 +0000 (12:13 -0700)]
Prepare for 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jk/tag-list-multiple-patterns' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:14 +0000 (12:41 -0700)]
Merge branch 'jk/tag-list-multiple-patterns' into maint

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

13 years agoMerge branch 'jl/submodule-update-quiet' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:14 +0000 (12:41 -0700)]
Merge branch 'jl/submodule-update-quiet' into maint

* jl/submodule-update-quiet:
  submodule: update and add must honor --quiet flag

13 years agoMerge branch 'jl/submodule-add-relurl-wo-upstream' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:13 +0000 (12:41 -0700)]
Merge branch 'jl/submodule-add-relurl-wo-upstream' into maint

* jl/submodule-add-relurl-wo-upstream:
  submodule add: clean up duplicated code
  submodule add: allow relative repository path even when no url is set
  submodule add: test failure when url is not configured in superproject

Conflicts:
git-submodule.sh

13 years agoMerge branch 'oa/pull-reflog' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:13 +0000 (12:41 -0700)]
Merge branch 'oa/pull-reflog' into maint

* oa/pull-reflog:
  pull: remove extra space from reflog message

13 years agoMerge branch 'js/ls-tree-error' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'js/ls-tree-error' into maint

* js/ls-tree-error:
  Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
  Add a test to check that git ls-tree sets non-zero exit code on error.

13 years agoMerge branch 'jk/fast-export-quote-path' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'jk/fast-export-quote-path' into maint

* jk/fast-export-quote-path:
  fast-export: quote paths in output

13 years agoMerge branch 'jc/checkout-reflog-fix' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'jc/checkout-reflog-fix' into maint

* jc/checkout-reflog-fix:
  checkout: do not write bogus reflog entry out

13 years agoMerge branch 'jc/maint-reset-unmerged-path' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'jc/maint-reset-unmerged-path' into maint

* jc/maint-reset-unmerged-path:
  reset [<commit>] paths...: do not mishandle unmerged paths

13 years agoMerge branch 'mz/doc-rebase-abort' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'mz/doc-rebase-abort' into maint

* mz/doc-rebase-abort:
  rebase: clarify "restore the original branch"

13 years agoMerge branch 'bw/log-all-ref-updates-doc' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'bw/log-all-ref-updates-doc' into maint

* bw/log-all-ref-updates-doc:
  Documentation: clearly specify what refs are honored by core.logAllRefUpdates

13 years agoMerge branch 'js/maint-add-path-stat-pwd' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:27 +0000 (11:41 -0700)]
Merge branch 'js/maint-add-path-stat-pwd' into maint

* js/maint-add-path-stat-pwd:
  get_pwd_cwd(): Do not trust st_dev/st_ino blindly

13 years agoMerge branch 'ms/help-unknown' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:27 +0000 (11:41 -0700)]
Merge branch 'ms/help-unknown' into maint

* ms/help-unknown:
  help_unknown_cmd: do not propose an "unknown" cmd

13 years agoMerge branch 'mz/doc-synopsis-verse' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'mz/doc-synopsis-verse' into maint

* mz/doc-synopsis-verse:
  Documentation: use [verse] for SYNOPSIS sections

13 years agoMerge branch 'jn/mime-type-with-params' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'jn/mime-type-with-params' into maint

* jn/mime-type-with-params:
  gitweb: Serve */*+xml 'blob_plain' as text/plain with $prevent_xss
  gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss

13 years agoMerge branch 'jc/submodule-sync-no-auto-vivify' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'jc/submodule-sync-no-auto-vivify' into maint

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

13 years agoMerge branch 'jc/zlib-wrap' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'jc/zlib-wrap' into maint

* 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

13 years agoMerge branch 'fk/relink-upon-ldflags-update' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'fk/relink-upon-ldflags-update' into maint

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

13 years agoMerge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into maint

* 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

13 years agoMerge branch 'aw/rebase-i-p' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:25 +0000 (11:23 -0700)]
Merge branch 'aw/rebase-i-p' into maint

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

13 years agoMerge branch 'jc/diff-index-quick-exit-early' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:25 +0000 (11:23 -0700)]
Merge branch 'jc/diff-index-quick-exit-early' into maint

* 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 'jk/combine-diff-binary-etc' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:24 +0000 (11:23 -0700)]
Merge branch 'jk/combine-diff-binary-etc' into maint

* 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 agoam: refresh the index at start and --resolved
Jeff King [Tue, 16 Aug 2011 00:13:07 +0000 (17:13 -0700)]
am: refresh the index at start and --resolved

If a file is unchanged but stat-dirty, we may erroneously
fail to apply patches, thinking that they conflict with a
dirty working tree.

This patch adds a call to "update-index --refresh". It comes
as late as possible, so that we don't bother with it for
thinks like "git rebase --abort", or when mbox-splitting
fails. However, it does come before we actually start
applying patches, meaning we will only call it once when we
start applying patches (or any time we return to "am" after
having resolved conflicts), and not once per patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.7
Junio C Hamano [Thu, 11 Aug 2011 19:12:22 +0000 (12:12 -0700)]
Update draft release notes to 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'cb/partial-commit-relative-pathspec'
Junio C Hamano [Thu, 11 Aug 2011 18:04:28 +0000 (11:04 -0700)]
Merge branch 'cb/partial-commit-relative-pathspec'

* cb/partial-commit-relative-pathspec:
  commit: allow partial commits with relative paths

13 years agoMerge branch 'jk/fast-export-quote-path'
Junio C Hamano [Thu, 11 Aug 2011 18:03:16 +0000 (11:03 -0700)]
Merge branch 'jk/fast-export-quote-path'

* jk/fast-export-quote-path:
  fast-export: quote paths in output

13 years agoMerge branch 'rc/maint-http-wrong-free'
Junio C Hamano [Thu, 11 Aug 2011 18:03:13 +0000 (11:03 -0700)]
Merge branch 'rc/maint-http-wrong-free'

* rc/maint-http-wrong-free:
  Makefile: some changes for http-related flag documentation
  http.c: fix an invalid free()

Conflicts:
Makefile

13 years agoMerge branch 'rs/grep-function-context'
Junio C Hamano [Thu, 11 Aug 2011 18:03:09 +0000 (11:03 -0700)]
Merge branch 'rs/grep-function-context'

* rs/grep-function-context:
  grep: long context options
  grep: add option to show whole function as context

13 years agoMerge branch 'ef/ipv4-connect-error-report'
Junio C Hamano [Thu, 11 Aug 2011 18:03:06 +0000 (11:03 -0700)]
Merge branch 'ef/ipv4-connect-error-report'

* ef/ipv4-connect-error-report:
  connect: only log if all attempts failed (ipv4)

13 years agoam: Document new --exclude=<path> option
maximilian attems [Tue, 9 Aug 2011 15:21:08 +0000 (17:21 +0200)]
am: Document new --exclude=<path> option

The --exclude=<path> option is passed down to apply; document it as such.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobisect: add support for bisecting bare repositories
Jon Seymour [Tue, 9 Aug 2011 02:11:54 +0000 (12:11 +1000)]
bisect: add support for bisecting bare repositories

This enhances the support for bisecting history in bare repositories.

The "git bisect" command no longer needs to be run inside a repository
with a working tree; it defaults to --no-checkout when run in a bare
repository.

Two tests are included to demonstrate this behaviour.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohelping smart-http/stateless-rpc fetch race
Junio C Hamano [Fri, 5 Aug 2011 20:54:06 +0000 (13:54 -0700)]
helping smart-http/stateless-rpc fetch race

A request to fetch from a client over smart HTTP protocol is served in
multiple steps. In the first round, the server side shows the set of refs
it has and their values, and the client picks from them and sends "I want
to fetch the history leading to these commits".

When the server tries to respond to this second request, its refs may have
progressed by a push from elsewhere. By design, we do not allow fetching
objects that are not at the tip of an advertised ref, and the server
rejects such a request. The client needs to try again, which is not ideal
especially for a busy server.

Teach upload-pack (which is the workhorse driven by git-daemon and smart
http server interface) that it is OK for a smart-http client to ask for
commits that are not at the tip of any advertised ref, as long as they are
reachable from advertised refs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoxdiff/xhistogram: drop need for additional variable
Tay Ray Chuan [Mon, 1 Aug 2011 04:20:10 +0000 (12:20 +0800)]
xdiff/xhistogram: drop need for additional variable

Having an additional variable (ptr) instead of changing line(1|2) and
count(1|2) was for debugging purposes.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoxdiff/xhistogram: rely on xdl_trim_ends()
Tay Ray Chuan [Mon, 1 Aug 2011 04:20:09 +0000 (12:20 +0800)]
xdiff/xhistogram: rely on xdl_trim_ends()

Do away with reduce_common_start_end() and use xdf->dstart and xdf->dend
set by xdl_trim_ends() that similarly tells us where the first unmatched
line from the start and end occurs.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoxdiff/xhistogram: rework handling of recursed results
Tay Ray Chuan [Mon, 1 Aug 2011 04:20:08 +0000 (12:20 +0800)]
xdiff/xhistogram: rework handling of recursed results

Previously we were over-complicating matters by trying to combine the
recursed results. Now, terminate immediately if a recursive call failed
and return its result.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'oa/pull-reflog'
Junio C Hamano [Mon, 8 Aug 2011 19:33:36 +0000 (12:33 -0700)]
Merge branch 'oa/pull-reflog'

* oa/pull-reflog:
  pull: remove extra space from reflog message

Conflicts:
git-pull.sh

13 years agoMerge branch 'ms/reflog-show-is-default'
Junio C Hamano [Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)]
Merge branch 'ms/reflog-show-is-default'

* ms/reflog-show-is-default:
  reflog: actually default to subcommand 'show'

13 years agoMerge branch 'jl/submodule-status-summary-doc'
Junio C Hamano [Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)]
Merge branch 'jl/submodule-status-summary-doc'

* jl/submodule-status-summary-doc:
  Documentation/submodule: add command references and update options

13 years agoMerge branch 'jn/gitweb-config-list-case'
Junio C Hamano [Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)]
Merge branch 'jn/gitweb-config-list-case'

* jn/gitweb-config-list-case:
  gitweb: Git config keys are case insensitive, make config search too

13 years agoMerge branch 'jl/submodule-update-quiet'
Junio C Hamano [Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)]
Merge branch 'jl/submodule-update-quiet'

* jl/submodule-update-quiet:
  submodule: update and add must honor --quiet flag

13 years agoMerge branch 'js/ls-tree-error'
Junio C Hamano [Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)]
Merge branch 'js/ls-tree-error'

* js/ls-tree-error:
  Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
  Add a test to check that git ls-tree sets non-zero exit code on error.

13 years agoMerge branch 'jn/gitweb-system-config'
Junio C Hamano [Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)]
Merge branch 'jn/gitweb-system-config'

* jn/gitweb-system-config:
  gitweb: Introduce common system-wide settings for convenience

13 years agoMerge branch 'jk/reset-reflog-message-fix'
Junio C Hamano [Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)]
Merge branch 'jk/reset-reflog-message-fix'

* jk/reset-reflog-message-fix:
  reset: give better reflog messages

13 years agoMerge branch 'jc/diff-index-refactor'
Junio C Hamano [Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)]
Merge branch 'jc/diff-index-refactor'

* jc/diff-index-refactor:
  diff-lib: refactor run_diff_index() and do_diff_cache()
  diff-lib: simplify do_diff_cache()

13 years agoreceive-pack: do not overstep command line argument array
Junio C Hamano [Mon, 8 Aug 2011 19:31:01 +0000 (12:31 -0700)]
receive-pack: do not overstep command line argument array

Previous commit added one element to the command line, without
making sure the result fits there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 8 Aug 2011 19:24:16 +0000 (12:24 -0700)]
Merge branch 'maint'

* maint:
  filter-branch: Export variable `workdir' for --commit-filter
  Documentation/Makefile: add *.pdf to `clean' target
  Documentation: ignore *.pdf files

13 years agofilter-branch: Export variable `workdir' for --commit-filter
Michael Witten [Sun, 7 Aug 2011 02:44:43 +0000 (02:44 +0000)]
filter-branch: Export variable `workdir' for --commit-filter

According to `git help filter-branch':

       --commit-filter <command>
           ...
           You can use the _map_ convenience function in this filter,
           and other convenience functions, too...
           ...

However, it turns out that `map' hasn't been usable because it depends
on the variable `workdir', which is not propogated to the environment
of the shell that runs the commit-filter <command> because the
shell is created via a simple-command rather than a compound-command
subshell:

 @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
                 $(git write-tree) $parentstr < ../message > ../map/$commit ||
                         die "could not write rewritten commit"

One solution is simply to export `workdir'. However, it seems rather
heavy-handed to export `workdir' to the environments of all commands,
so instead this commit exports `workdir' for only the duration of the
shell command in question:

 workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
                 $(git write-tree) $parentstr < ../message > ../map/$commit ||
                         die "could not write rewritten commit"

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/Makefile: add *.pdf to `clean' target
Emilio G. Cota [Mon, 8 Aug 2011 08:33:05 +0000 (04:33 -0400)]
Documentation/Makefile: add *.pdf to `clean' target

user-manual.pdf is not removed by `make clean'; fix it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: ignore *.pdf files
Emilio G. Cota [Mon, 8 Aug 2011 08:33:04 +0000 (04:33 -0400)]
Documentation: ignore *.pdf files

user-manual.pdf is generated by the build and therefore
should be ignored by git.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofast-export: quote paths in output
Jeff King [Fri, 5 Aug 2011 22:36:22 +0000 (16:36 -0600)]
fast-export: quote paths in output

Many pathnames in a fast-import stream need to be quoted. In
particular:

  1. Pathnames at the end of an "M" or "D" line need quoting
     if they contain a LF or start with double-quote.

  2. Pathnames on a "C" or "R" line need quoting as above,
     but also if they contain spaces.

For (1), we weren't quoting at all. For (2), we put
double-quotes around the paths to handle spaces, but ignored
the possibility that they would need further quoting.

This patch checks whether each pathname needs c-style
quoting, and uses it. This is slightly overkill for (1),
which doesn't actually need to quote many characters that
vanilla c-style quoting does. However, it shouldn't hurt, as
any implementation needs to be ready to handle quoted
strings anyway.

In addition to adding a test, we have to tweak a test which
blindly assumed that case (2) would always use
double-quotes, whether it needed to or not.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofilter-branch.sh: de-dent usage string
Junio C Hamano [Fri, 5 Aug 2011 22:06:21 +0000 (15:06 -0700)]
filter-branch.sh: de-dent usage string

"Usage: git filter-branch " that is prefixed to the first line is 25
columns long, so the "[--index-filter ..." on the second line would not
align with "[--env-filter ..." on the first line to begin with. If the
second and subsequent lines do not aim to align with anything on the
first line, it is just fine to indent them with a single HT.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomisc-sh: fix up whitespace in some other .sh files.
Jon Seymour [Fri, 5 Aug 2011 13:31:29 +0000 (23:31 +1000)]
misc-sh: fix up whitespace in some other .sh files.

I found that the patched 4 files were different when this
filter is applied.

expand -i | unexpand --first-only

This patch contains the corrected files.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'tc/minix'
Junio C Hamano [Fri, 5 Aug 2011 21:55:00 +0000 (14:55 -0700)]
Merge branch 'tc/minix'

* tc/minix:
  Makefile: add Minix configuration options.

13 years agoMerge branch 'jc/pack-order-tweak'
Junio C Hamano [Fri, 5 Aug 2011 21:54:57 +0000 (14:54 -0700)]
Merge branch 'jc/pack-order-tweak'

* jc/pack-order-tweak:
  pack-objects: optimize "recency order"
  core: log offset pack data accesses happened

13 years agobisect: further style nitpicks
Junio C Hamano [Fri, 5 Aug 2011 17:09:23 +0000 (10:09 -0700)]
bisect: further style nitpicks

Fix a few remaining lines that indented with spaces.

Also simplify the logic of checking out the original branch and reporting
error during "bisect reset".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobisect: replace "; then" with "\n<tab>*then"
Jon Seymour [Fri, 5 Aug 2011 11:31:31 +0000 (21:31 +1000)]
bisect: replace "; then" with "\n<tab>*then"

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobisect: cleanup whitespace errors in git-bisect.sh.
Jon Seymour [Fri, 5 Aug 2011 11:31:30 +0000 (21:31 +1000)]
bisect: cleanup whitespace errors in git-bisect.sh.

All leading whitespace is now encoded with tabs.

After this patch, the following is true:

RAW=$(cat git-bisect.sh | md5sum) &&
ROUNDTRIP=$(cat git-bisect.sh | expand -i - | unexpand --first-only - | md5sum) &&
LEADING=$(sed -n "/^  */p" < git-bisect.sh | wc -l) &&
test $RAW = $ROUNDTRIP &&
test $LEADING = 0 &&
test -z "$(git diff -w HEAD~1 HEAD)"

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-path-utils: Add subcommand "prefix_path"
Michael Haggerty [Thu, 4 Aug 2011 04:47:48 +0000 (06:47 +0200)]
test-path-utils: Add subcommand "prefix_path"

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-path-utils: Add subcommand "absolute_path"
Michael Haggerty [Thu, 4 Aug 2011 04:47:47 +0000 (06:47 +0200)]
test-path-utils: Add subcommand "absolute_path"

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Normalize paths
Michael Haggerty [Thu, 4 Aug 2011 04:47:46 +0000 (06:47 +0200)]
git-check-attr: Normalize paths

Normalize the path arguments (relative to the working tree root, if
applicable) before looking up their attributes.  This requires passing
the prefix down the call chain.

This fixes two test cases for different reasons:

* "unnormalized paths" is fixed because the .gitattribute-file-seeking
  code is not confused into reading the top-level file twice.

* "relative paths" is fixed because the canonical pathnames are passed
  to get_check_attr() or get_all_attrs(), allowing them to match the
  pathname patterns as expected.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Demonstrate problems with relative paths
Michael Haggerty [Thu, 4 Aug 2011 04:47:45 +0000 (06:47 +0200)]
git-check-attr: Demonstrate problems with relative paths

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Demonstrate problems with unnormalized paths
Michael Haggerty [Thu, 4 Aug 2011 04:47:44 +0000 (06:47 +0200)]
git-check-attr: Demonstrate problems with unnormalized paths

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: test that no output is written to stderr
Michael Haggerty [Thu, 4 Aug 2011 04:47:43 +0000 (06:47 +0200)]
git-check-attr: test that no output is written to stderr

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRename git_checkattr() to git_check_attr()
Michael Haggerty [Thu, 4 Aug 2011 04:36:33 +0000 (06:36 +0200)]
Rename git_checkattr() to git_check_attr()

Suggested by: Junio Hamano <gitster@pobox.com>

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Fix command-line handling to match docs
Michael Haggerty [Thu, 4 Aug 2011 04:36:32 +0000 (06:36 +0200)]
git-check-attr: Fix command-line handling to match docs

According to the git-check-attr synopsis, if the '--stdin' option is
used then no pathnames are expected on the command line.  Change the
behavior to match this description; namely, if '--stdin' is used but
not '--', then treat all command-line arguments as attribute names.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Drive two tests using the same raw data
Michael Haggerty [Thu, 4 Aug 2011 04:36:31 +0000 (06:36 +0200)]
git-check-attr: Drive two tests using the same raw data

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Add an --all option to show all attributes
Michael Haggerty [Thu, 4 Aug 2011 04:36:30 +0000 (06:36 +0200)]
git-check-attr: Add an --all option to show all attributes

Add new usage patterns

    git check-attr [-a | --all] [--] pathname...
    git check-attr --stdin [-a | --all] < <list-of-paths>

which display all attributes associated with the specified file(s).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Error out if no pathnames are specified
Michael Haggerty [Thu, 4 Aug 2011 04:36:29 +0000 (06:36 +0200)]
git-check-attr: Error out if no pathnames are specified

If no pathnames are passed as command-line arguments and the --stdin
option is not specified, fail with the error message "No file
specified".  Add tests of this behavior.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Process command-line args more systematically
Michael Haggerty [Thu, 4 Aug 2011 04:36:28 +0000 (06:36 +0200)]
git-check-attr: Process command-line args more systematically

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Handle each error separately
Michael Haggerty [Thu, 4 Aug 2011 04:36:27 +0000 (06:36 +0200)]
git-check-attr: Handle each error separately

This will make the code easier to refactor.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Extract a function error_with_usage()
Michael Haggerty [Thu, 4 Aug 2011 04:36:26 +0000 (06:36 +0200)]
git-check-attr: Extract a function error_with_usage()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Introduce a new variable
Michael Haggerty [Thu, 4 Aug 2011 04:36:25 +0000 (06:36 +0200)]
git-check-attr: Introduce a new variable

Avoid reusing variable "doubledash" to mean something other than the
expected "position of a double-dash, if any".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Extract a function output_attr()
Michael Haggerty [Thu, 4 Aug 2011 04:36:24 +0000 (06:36 +0200)]
git-check-attr: Extract a function output_attr()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAllow querying all attributes on a file
Michael Haggerty [Thu, 4 Aug 2011 04:36:23 +0000 (06:36 +0200)]
Allow querying all attributes on a file

Add a function, git_all_attrs(), that reports on all attributes that
are set on a path.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRemove redundant check
Michael Haggerty [Thu, 4 Aug 2011 04:36:22 +0000 (06:36 +0200)]
Remove redundant check

bootstrap_attr_stack() also checks whether attr_stack is already set.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRemove redundant call to bootstrap_attr_stack()
Michael Haggerty [Thu, 4 Aug 2011 04:36:21 +0000 (06:36 +0200)]
Remove redundant call to bootstrap_attr_stack()

prepare_attr_stack() does the same thing.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoExtract a function collect_all_attrs()
Michael Haggerty [Thu, 4 Aug 2011 04:36:20 +0000 (06:36 +0200)]
Extract a function collect_all_attrs()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoTeach prepare_attr_stack() to figure out dirlen itself
Michael Haggerty [Thu, 4 Aug 2011 04:36:19 +0000 (06:36 +0200)]
Teach prepare_attr_stack() to figure out dirlen itself

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Use git_attr_name()
Michael Haggerty [Thu, 4 Aug 2011 04:36:18 +0000 (06:36 +0200)]
git-check-attr: Use git_attr_name()

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoProvide access to the name attribute of git_attr
Michael Haggerty [Thu, 4 Aug 2011 04:36:17 +0000 (06:36 +0200)]
Provide access to the name attribute of git_attr

It will be present in any likely future reimplementation, and its
availability simplifies other code.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Add tests of command-line parsing
Michael Haggerty [Thu, 4 Aug 2011 04:36:16 +0000 (06:36 +0200)]
git-check-attr: Add tests of command-line parsing

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-check-attr: Add missing "&&"
Michael Haggerty [Thu, 4 Aug 2011 04:36:15 +0000 (06:36 +0200)]
git-check-attr: Add missing "&&"

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDisallow the empty string as an attribute name
Michael Haggerty [Thu, 4 Aug 2011 04:36:14 +0000 (06:36 +0200)]
Disallow the empty string as an attribute name

Previously, it was possible to have a line like "file.txt =foo" in a
.gitattribute file, after which an invocation like "git check-attr ''
-- file.txt" would succeed.  This patch disallows both constructs.

Please note that any existing .gitattributes file that tries to set an
empty attribute will now trigger the error message "error: : not a
valid attribute name" whereas previously the nonsense was allowed
through.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>