Code

git.git
13 years agoMerge branch 'maint-1.7.1' into maint-1.7.2
Junio C Hamano [Thu, 2 Dec 2010 00:40:20 +0000 (16:40 -0800)]
Merge branch 'maint-1.7.1' into maint-1.7.2

* maint-1.7.1:
  add: introduce add.ignoreerrors synonym for add.ignore-errors

13 years agoMerge branch 'maint-1.7.0' into maint-1.7.1
Junio C Hamano [Thu, 2 Dec 2010 00:37:34 +0000 (16:37 -0800)]
Merge branch 'maint-1.7.0' into maint-1.7.1

* maint-1.7.0:
  add: introduce add.ignoreerrors synonym for add.ignore-errors

13 years agoMake the tab width used for whitespace checks configurable
Johannes Sixt [Tue, 30 Nov 2010 08:29:11 +0000 (09:29 +0100)]
Make the tab width used for whitespace checks configurable

A new whitespace "rule" is added that sets the tab width to use for
whitespace checks and fix-ups and replaces the hard-coded constant 8.

Since the setting is part of the rules, it can be set per file using
.gitattributes.

The new configuration is backwards compatible because older git versions
simply ignore unknown whitespace rules.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'js/maint-apply-tab-in-indent-fix' into HEAD
Junio C Hamano [Wed, 1 Dec 2010 22:42:00 +0000 (14:42 -0800)]
Merge branch 'js/maint-apply-tab-in-indent-fix' into HEAD

* js/maint-apply-tab-in-indent-fix:
  apply --whitespace=fix: fix tab-in-indent

13 years agoapply --whitespace=fix: fix tab-in-indent
Johannes Sixt [Tue, 30 Nov 2010 08:22:04 +0000 (09:22 +0100)]
apply --whitespace=fix: fix tab-in-indent

When the whitespace rule tab-in-indent is enabled, apply --whitespace=fix
replaces tabs by the appropriate amount of blanks. The code used
"dst->len % 8" as the criterion to stop adding blanks. But it forgot that
dst holds more than just the current line. Consequently, the modulus was
computed correctly only for the first added line, but not for the second
and subsequent lines. Fix it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd: introduce add.ignoreerrors synonym for add.ignore-errors
Jonathan Nieder [Wed, 1 Dec 2010 18:36:15 +0000 (12:36 -0600)]
add: introduce add.ignoreerrors synonym for add.ignore-errors

The "[add] ignore-errors" tweakable introduced by v1.5.6-rc0~30^2 (Add
a config option to ignore errors for git-add, 2008-05-12) does not
follow the usual convention for naming values in the git configuration
file.

What convention?  Glad you asked.

The section name indicates the affected subsystem.

The subsection name, if any, indicates which of
an unbound set of things to set the value for.

The variable name describes the effect of tweaking
this knob.

The section and variable names can be broken into
words using bumpyCaps in documentation as a hint to
the reader.  These word breaks are not significant
at the level of code, since the section and variable
names are not case sensitive.

The name "add.ignore-errors" includes a dash, meaning a naive
configuration file like

[add]
ignoreErrors

does not have any effect.  Avoid such confusion by renaming to the
more consistent add.ignoreErrors, but keep the old version for
backwards compatibility.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit.c: Remove backward goto in read_craft_line()
Ralf Thielow [Wed, 1 Dec 2010 19:15:59 +0000 (20:15 +0100)]
commit.c: Remove backward goto in read_craft_line()

Bad graft data is noticed in several places in read_graft_line(), and in
each case we go back to the first site of detection.  It in general is a
better style to have an exception handling out of line from the main
codepath and make error codepath jump forward.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobash: Match lightweight tags in prompt
knittl [Wed, 1 Dec 2010 13:17:00 +0000 (14:17 +0100)]
bash: Match lightweight tags in prompt

The bash prompt would display a commit's object name when having checked
out a lightweight tag.  Provide `--tags` to `git describe` in the completion
script, so it will display lightweight tag names, as it already does for
annotated tags.

Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-commit.txt: (synopsis): move -i and -o before "--"
Jari Aalto [Wed, 1 Dec 2010 14:51:25 +0000 (16:51 +0200)]
git-commit.txt: (synopsis): move -i and -o before "--"

All options, including -i and -o, must come before "--" which is the
end of options marker.

Reported-by: Joey Hess <joey@kitenet.net>
Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'cb/leading-path-removal'
Junio C Hamano [Tue, 30 Nov 2010 01:52:36 +0000 (17:52 -0800)]
Merge branch 'cb/leading-path-removal'

* cb/leading-path-removal:
  use persistent memory for rejected paths
  do not overwrite files in leading path
  lstat_cache: optionally return match_len
  add function check_ok_to_remove()
  t7607: add leading-path tests
  t7607: use test-lib functions and check MERGE_HEAD

Conflicts:
t/t7607-merge-overwrite.sh

13 years agoMerge branch 'en/merge-recursive'
Junio C Hamano [Tue, 30 Nov 2010 01:52:35 +0000 (17:52 -0800)]
Merge branch 'en/merge-recursive'

* en/merge-recursive: (41 commits)
  t6022: Use -eq not = to test output of wc -l
  merge-recursive:make_room_for_directories - work around dumb compilers
  merge-recursive: Remove redundant path clearing for D/F conflicts
  merge-recursive: Make room for directories in D/F conflicts
  handle_delete_modify(): Check whether D/F conflicts are still present
  merge_content(): Check whether D/F conflicts are still present
  conflict_rename_rename_1to2(): Fix checks for presence of D/F conflicts
  conflict_rename_delete(): Check whether D/F conflicts are still present
  merge-recursive: Delay modify/delete conflicts if D/F conflict present
  merge-recursive: Delay content merging for renames
  merge-recursive: Delay handling of rename/delete conflicts
  merge-recursive: Move handling of double rename of one file to other file
  merge-recursive: Move handling of double rename of one file to two
  merge-recursive: Avoid doubly merging rename/add conflict contents
  merge-recursive: Update merge_content() call signature
  merge-recursive: Update conflict_rename_rename_1to2() call signature
  merge-recursive: Structure process_df_entry() to handle more cases
  merge-recursive: Have process_entry() skip D/F or rename entries
  merge-recursive: New function to assist resolving renames in-core only
  merge-recursive: New data structures for deferring of D/F conflicts
  ...

Conflicts:
t/t6020-merge-df.sh
t/t6036-recursive-corner-cases.sh

13 years agoMerge branch 'jl/clone-recurse-sm-synonym'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jl/clone-recurse-sm-synonym'

* jl/clone-recurse-sm-synonym:
  clone: Add the --recurse-submodules option as alias for --recursive

13 years agoMerge branch 'jn/cherry-pick-refresh-index'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jn/cherry-pick-refresh-index'

* jn/cherry-pick-refresh-index:
  cherry-pick/revert: transparently refresh index

13 years agoMerge branch 'jc/emfile'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jc/emfile'

* jc/emfile:
  A loose object is not corrupt if it cannot be read due to EMFILE
  read_sha1_file(): report correct name of packfile with a corrupt object

13 years agoMerge branch 'md/interix'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'md/interix'

* md/interix:
  Interix: add configure checks
  add support for the SUA layer (interix; windows)

Conflicts:
git-compat-util.h

13 years agoMerge branch 'jl/add-p-reverse-message'
Junio C Hamano [Tue, 30 Nov 2010 01:52:34 +0000 (17:52 -0800)]
Merge branch 'jl/add-p-reverse-message'

* jl/add-p-reverse-message:
  Correct help blurb in checkout -p and friends

13 years agoMerge branch 'np/pack-broken-boundary'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'np/pack-broken-boundary'

* np/pack-broken-boundary:
  make pack-objects a bit more resilient to repo corruption

13 years agoMerge branch 'np/diff-in-corrupt-repository'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'np/diff-in-corrupt-repository'

* np/diff-in-corrupt-repository:
  diff: don't presume empty file when corresponding object is missing

13 years agoMerge branch 'fc/apply-p2-get-header-name'
Junio C Hamano [Tue, 30 Nov 2010 01:52:33 +0000 (17:52 -0800)]
Merge branch 'fc/apply-p2-get-header-name'

* fc/apply-p2-get-header-name:
  test: git-apply -p2 rename/chmod only
  Fix git-apply with -p greater than 1

13 years agoMerge branch 'jn/fast-import-fix'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'jn/fast-import-fix'

* jn/fast-import-fix:
  fast-import: do not clear notes in do_change_note_fanout()
  t9300 (fast-import): another test for the "replace root" feature
  fast-import: tighten M 040000 syntax
  fast-import: filemodify after M 040000 <tree> "" crashes

13 years agoMerge branch 'rr/needs-clean-work-tree'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'rr/needs-clean-work-tree'

* rr/needs-clean-work-tree:
  Porcelain scripts: Rewrite cryptic "needs update" error message

13 years agoMerge branch 'kb/blame-author-email'
Junio C Hamano [Tue, 30 Nov 2010 01:52:32 +0000 (17:52 -0800)]
Merge branch 'kb/blame-author-email'

* kb/blame-author-email:
  blame: Add option to show author email instead of name

Conflicts:
t/annotate-tests.sh

13 years agoMerge branch 'cm/diff-check-at-eol'
Junio C Hamano [Tue, 30 Nov 2010 01:52:31 +0000 (17:52 -0800)]
Merge branch 'cm/diff-check-at-eol'

* cm/diff-check-at-eol:
  diff --check: correct line numbers of new blank lines at EOF

13 years agoMerge branch 'ak/apply-non-git-epoch'
Junio C Hamano [Tue, 30 Nov 2010 01:52:31 +0000 (17:52 -0800)]
Merge branch 'ak/apply-non-git-epoch'

* ak/apply-non-git-epoch:
  apply: handle patches with funny filename and colon in timezone
  apply: Recognize epoch timestamps with : in the timezone

13 years agoMerge branch 'tc/smart-http-post-redirect'
Junio C Hamano [Tue, 30 Nov 2010 01:52:30 +0000 (17:52 -0800)]
Merge branch 'tc/smart-http-post-redirect'

* tc/smart-http-post-redirect:
  smart-http: Don't change POST to GET when following redirect

13 years agogitweb: document $per_request_config better
Jonathan Nieder [Mon, 29 Nov 2010 00:19:08 +0000 (18:19 -0600)]
gitweb: document $per_request_config better

Global variables $my_url, $my_uri and $base_url have subtle interactions
that need to be desribed, and can be influenced most cleanly by
$per_request_config.

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 agogitweb: selectable configurations that change with each request
Jakub Narebski [Thu, 25 Nov 2010 18:43:59 +0000 (19:43 +0100)]
gitweb: selectable configurations that change with each request

Allow selecting whether configuration file should be (re)parsed on each
request (the default, for backward compatibility with configurations that
change per session, see commit 7f425db (gitweb: allow configurations that
change with each request, 2010-07-30)), or whether should it be parsed only
once (for performance speedup for persistent environments, though currently
only FastCGI is able to make use of it, when flexibility is not important).

You can also have configuration file parsed only once, but have parts of
configuration (re)evaluated once per each request.

This is done by introducing $per_request_config variable: if set to code
reference, this code would be run once per request, while config file would
be parsed only once.  For example gitolite's contrib/gitweb/gitweb.conf
fragment mentioned in 7f425db could be rewritten as

  our $per_request_config = sub {
   $ENV{GL_USER} = ($cgi && $cgi->remote_user) || "gitweb";
  };

to make use of this feature.

If $per_request_config is not a code reference, it is taken to be boolean
variable, to choose between running config file for each request
(flexibility), and running config file only once (performance in
persistent environments).

The default value for $per_request_config is 1 (true), which means that
old configuration that require to change per session (like gitolite's)
will keep working.

While at it, make it so evaluate_git_version() is run only once.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUse reflog in 'pull --rebase . foo'
Martin von Zweigbergk [Sat, 13 Nov 2010 22:58:22 +0000 (23:58 +0100)]
Use reflog in 'pull --rebase . foo'

Since c85c792 (pull --rebase: be cleverer with rebased upstream
branches, 2008-01-26), "git pull --rebase" has used the reflog to try to
rebase from the old upstream onto the new upstream.

Make this work if the local repository is explicitly passed on the
command line as in 'git pull --rebase . foo'.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Acked-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: only show stat if configured to true
Martin von Zweigbergk [Tue, 9 Nov 2010 20:59:00 +0000 (21:59 +0100)]
rebase: only show stat if configured to true

If rebase.stat is set to true, a diffstat should be displayed. If it is
not set, it should default to false. However, if it is explicitly set to
false (or other value), a diffstat is still displayed, which is probably
not what most users would expect. Show diffstat only if it is set
to true.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoentry.c: remove "checkout-index" from error messages
Nguyễn Thái Ngọc Duy [Sun, 28 Nov 2010 04:36:38 +0000 (11:36 +0700)]
entry.c: remove "checkout-index" from error messages

Back then when entry.c was part of checkout-index (or checkout-cache
at that time [1]). It makes sense to print the command name in error
messages. Nowadays entry.c is in libgit and can be used by any
commands, printing "git checkout-index: blah" does no more than
confusion. The error messages without it still give enough information.

[1] 12dccc1 (Make fiel checkout function available to the git library - 2005-06-05)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-fetch: rework url handling
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:10 +0000 (16:21 +0800)]
http-fetch: rework url handling

Do away with a second url variable, rewritten_url, and make url
non-const. This is safe because the functions called with url (ie.
get_http_walker() and walker_fetch()) do not modify it (ie. marked with
const char *).

Also, replace code that adds a trailing slash with a call to
str_end_url_with_slash().

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-push: add trailing slash at arg-parse time, instead of later on
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:09 +0000 (16:21 +0800)]
http-push: add trailing slash at arg-parse time, instead of later on

That way, we don't have to update repo->path and repo->path_len again
after adding the trailing slash.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-push: check path length before using it
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:08 +0000 (16:21 +0800)]
http-push: check path length before using it

We use path_len to skip the base url/path, but we do not know for sure
if path does indeed contain the base url/path. Check if this is so.

Helped-by: Johnathan Nieder <jrnieder@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-push: Normalise directory names when pushing to some WebDAV servers
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:07 +0000 (16:21 +0800)]
http-push: Normalise directory names when pushing to some WebDAV servers

Fix a bug when pushing to WebDAV servers which do not use a trailing
slash for collection names. The previous implementation fails to see
that the requested resource "refs/" is the same resource as "refs"
and loads every reference twice (once for refs/ and once for refs).

This implementation normalises every collection name by appending a
trailing slash if necessary.

This can be tested with old versions of Apache (such as the WebDAV
server of GMX, Apache 2.0.63).

Based-on-patch-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-backend: use end_url_with_slash()
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:06 +0000 (16:21 +0800)]
http-backend: use end_url_with_slash()

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agourl: add str wrapper for end_url_with_slash()
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:05 +0000 (16:21 +0800)]
url: add str wrapper for end_url_with_slash()

Helped-by: Johnathan Nieder <jrnieder@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoshift end_url_with_slash() from http.[ch] to url.[ch]
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:04 +0000 (16:21 +0800)]
shift end_url_with_slash() from http.[ch] to url.[ch]

This allows non-http/curl users to access it too (eg. http-backend.c).

Update include headers in end_url_with_slash() users too.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot5550-http-fetch: add test for http-fetch
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:03 +0000 (16:21 +0800)]
t5550-http-fetch: add test for http-fetch

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot5550-http-fetch: add missing '&&'
Tay Ray Chuan [Thu, 25 Nov 2010 08:21:02 +0000 (16:21 +0800)]
t5550-http-fetch: add missing '&&'

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'en/and-cascade-tests'
Junio C Hamano [Fri, 26 Nov 2010 22:45:37 +0000 (14:45 -0800)]
Merge branch 'en/and-cascade-tests'

* en/and-cascade-tests:
  t7300: add a missing SYMLINKS prerequisite

13 years agot7300: add a missing SYMLINKS prerequisite
Johannes Sixt [Thu, 25 Nov 2010 08:03:39 +0000 (09:03 +0100)]
t7300: add a missing SYMLINKS prerequisite

The test fails on Windows since 2dec68c (tests: add missing &&, batch 2).

Even though this test allocates and leaves behind files, subsequent tests
do not depend on this, so it is safe to just skip it.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'cb/maint-orphan-merge-noclobber'
Junio C Hamano [Wed, 24 Nov 2010 23:55:36 +0000 (15:55 -0800)]
Merge branch 'cb/maint-orphan-merge-noclobber'

* cb/maint-orphan-merge-noclobber:
  do not overwrite untracked during merge from unborn branch

13 years agoMerge branch 'ao/send-email-irt'
Junio C Hamano [Wed, 24 Nov 2010 23:55:32 +0000 (15:55 -0800)]
Merge branch 'ao/send-email-irt'

* ao/send-email-irt:
  git-send-email.perl: make initial In-Reply-To apply only to first email
  t9001: send-email interation with --in-reply-to and --chain-reply-to

13 years agoMerge branch 'jk/add-e-doc'
Junio C Hamano [Wed, 24 Nov 2010 23:55:29 +0000 (15:55 -0800)]
Merge branch 'jk/add-e-doc'

* jk/add-e-doc:
  docs: give more hints about how "add -e" works
  docs: give more hints about how "add -e" works

13 years agoMerge branch 'rs/opt-help-text'
Junio C Hamano [Wed, 24 Nov 2010 23:55:19 +0000 (15:55 -0800)]
Merge branch 'rs/opt-help-text'

* rs/opt-help-text:
  verify-tag: document --verbose
  branch: improve --verbose description
  archive: improve --verbose description
  Describe various forms of "be quiet" using OPT__QUIET
  add OPT__FORCE
  add description parameter to OPT__QUIET
  add description parameter to OPT__DRY_RUN
  add description parameter to OPT__VERBOSE

13 years agoMerge branch 'kb/maint-rebase-autosquash'
Junio C Hamano [Wed, 24 Nov 2010 23:55:15 +0000 (15:55 -0800)]
Merge branch 'kb/maint-rebase-autosquash'

* kb/maint-rebase-autosquash:
  rebase: teach --autosquash to match on sha1 in addition to message
  rebase: better rearranging of fixup!/squash! lines with --autosquash

13 years agoMerge branch 'mm/phrase-remote-tracking'
Junio C Hamano [Wed, 24 Nov 2010 23:55:05 +0000 (15:55 -0800)]
Merge branch 'mm/phrase-remote-tracking'

* mm/phrase-remote-tracking:
  git-branch.txt: mention --set-upstream as a way to change upstream configuration
  user-manual: remote-tracking can be checked out, with detached HEAD
  user-manual.txt: explain better the remote(-tracking) branch terms
  Change incorrect "remote branch" to "remote tracking branch" in C code
  Change incorrect uses of "remote branch" meaning "remote-tracking"
  Change "tracking branch" to "remote-tracking branch"
  everyday.txt: change "tracking branch" to "remote-tracking branch"
  Change remote tracking to remote-tracking in non-trivial places
  Replace "remote tracking" with "remote-tracking"
  Better "Changed but not updated" message in git-status

13 years agoMerge branch 'en/and-cascade-tests'
Junio C Hamano [Wed, 24 Nov 2010 23:51:49 +0000 (15:51 -0800)]
Merge branch 'en/and-cascade-tests'

* en/and-cascade-tests: (25 commits)
  t4124 (apply --whitespace): use test_might_fail
  t3404: do not use 'describe' to implement test_cmp_rev
  t3404 (rebase -i): introduce helper to check position of HEAD
  t3404 (rebase -i): move comment to description
  t3404 (rebase -i): unroll test_commit loops
  t3301 (notes): use test_expect_code for clarity
  t1400 (update-ref): use test_must_fail
  t1502 (rev-parse --parseopt): test exit code from "-h"
  t6022 (renaming merge): chain test commands with &&
  test-lib: introduce test_line_count to measure files
  tests: add missing &&, batch 2
  tests: add missing &&
  Introduce sane_unset and use it to ensure proper && chaining
  t7800 (difftool): add missing &&
  t7601 (merge-pull-config): add missing &&
  t7001 (mv): add missing &&
  t6016 (rev-list-graph-simplify-history): add missing &&
  t5602 (clone-remote-exec): add missing &&
  t4026 (color): remove unneeded and unchained command
  t4019 (diff-wserror): add lots of missing &&
  ...

Conflicts:
t/t7006-pager.sh

13 years agodocs: default to more modern toolset
Jeff King [Fri, 19 Nov 2010 17:54:24 +0000 (12:54 -0500)]
docs: default to more modern toolset

When the ASCIIDOC8 and ASCIIDOC_NO_ROFF knobs were built,
many people were still on asciidoc 7 and using older
versions of docbook-xsl. These days, even the almost
2-year-old Debian stable needs these knobs turned.

So let's turn them by default. The new knobs ASCIIDOC7 and
ASCIIDOC_ROFF can be used to get the old behavior if people
are on older systems.

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 [Wed, 24 Nov 2010 21:24:49 +0000 (13:24 -0800)]
Merge branch 'maint'

* maint:
  imap-send: link against libcrypto for HMAC and others
  git-send-email.perl: Deduplicate "to:" and "cc:" entries with names
  mingw: do not set errno to 0 on success

13 years agoMerge branch 'jl/maint-pull-tags-doc' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:42 +0000 (12:47 -0800)]
Merge branch 'jl/maint-pull-tags-doc' into maint

* jl/maint-pull-tags-doc:
  pull: Remove --tags option from manpage

13 years agoMerge branch 'kb/maint-diff-ws-check' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:27 +0000 (12:47 -0800)]
Merge branch 'kb/maint-diff-ws-check' into maint

* kb/maint-diff-ws-check:
  diff: handle lines containing only whitespace and tabs better
  test-lib: extend test_decode_color to handle more color codes

13 years agoMerge branch 'jm/mailmap' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:18 +0000 (12:47 -0800)]
Merge branch 'jm/mailmap' into maint

* jm/mailmap:
  t4203: do not let "git shortlog" DWIM based on tty
  t4203 (mailmap): stop hardcoding commit ids and dates
  mailmap: fix use of freed memory

13 years agoMerge branch 'tr/maint-git-repack-tmpfile' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:10 +0000 (12:47 -0800)]
Merge branch 'tr/maint-git-repack-tmpfile' into maint

* tr/maint-git-repack-tmpfile:
  repack: place temporary packs under .git/objects/pack/

13 years agoMerge branch 'jk/maint-apply-no-binary' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:47:04 +0000 (12:47 -0800)]
Merge branch 'jk/maint-apply-no-binary' into maint

* jk/maint-apply-no-binary:
  apply: don't segfault on binary files with missing data

13 years agoMerge branch 'jn/send-pack-error' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:46 +0000 (12:46 -0800)]
Merge branch 'jn/send-pack-error' into maint

* jn/send-pack-error:
  send-pack: avoid redundant "pack-objects died with strange error"

13 years agoMerge branch 'ak/submodule-sync' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:40 +0000 (12:46 -0800)]
Merge branch 'ak/submodule-sync' into maint

* ak/submodule-sync:
  submodule sync: Update "submodule.<name>.url" for empty directories

13 years agoMerge branch 'jk/maint-rev-list-nul' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:32 +0000 (12:46 -0800)]
Merge branch 'jk/maint-rev-list-nul' into maint

* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format

13 years agoMerge branch 'cb/diff-fname-optim' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:26 +0000 (12:46 -0800)]
Merge branch 'cb/diff-fname-optim' into maint

* cb/diff-fname-optim:
  diff: avoid repeated scanning while looking for funcname
  do not search functions for patch ID
  add rebase patch id tests

13 years agoMerge branch 'jk/no-textconv-symlink' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:20 +0000 (12:46 -0800)]
Merge branch 'jk/no-textconv-symlink' into maint

* jk/no-textconv-symlink:
  diff: don't use pathname-based diff drivers for symlinks

13 years agoMerge branch 'dk/maint-blame-el' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:17 +0000 (12:46 -0800)]
Merge branch 'dk/maint-blame-el' into maint

* dk/maint-blame-el:
  git-blame.el: Add (require 'format-spec)

13 years agoMerge branch 'aw/git-p4-deletion' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:46:14 +0000 (12:46 -0800)]
Merge branch 'aw/git-p4-deletion' into maint

* aw/git-p4-deletion:
  Fix handling of git-p4 on deleted files

13 years agoMerge branch 'kf/post-receive-sample-hook' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:45:39 +0000 (12:45 -0800)]
Merge branch 'kf/post-receive-sample-hook' into maint

* kf/post-receive-sample-hook:
  post-receive-email: ensure sent messages are not empty

13 years agoMerge branch 'jk/repack-reuse-object' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:45:07 +0000 (12:45 -0800)]
Merge branch 'jk/repack-reuse-object' into maint

* jk/repack-reuse-object:
  Documentation: pack.compression: explain how to recompress
  repack: add -F flag to let user choose between --no-reuse-delta/object

Conflicts:
Documentation/git-repack.txt

13 years agoMerge branch 'bc/fix-cherry-pick-root' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:44:46 +0000 (12:44 -0800)]
Merge branch 'bc/fix-cherry-pick-root' into maint

* bc/fix-cherry-pick-root:
  builtin/revert.c: don't dereference a NULL pointer

13 years agoMerge branch 'uk/fix-author-ident-sed-script' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:44:41 +0000 (12:44 -0800)]
Merge branch 'uk/fix-author-ident-sed-script' into maint

* uk/fix-author-ident-sed-script:
  get_author_ident_from_commit(): remove useless quoting

13 years agoMerge branch 'ab/makefile-track-cc' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:44:35 +0000 (12:44 -0800)]
Merge branch 'ab/makefile-track-cc' into maint

* ab/makefile-track-cc:
  Makefile: add CC to TRACK_CFLAGS

13 years agoMerge branch 'mg/reset-doc' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:44:26 +0000 (12:44 -0800)]
Merge branch 'mg/reset-doc' into maint

* mg/reset-doc:
  git-reset.txt: make modes description more consistent
  git-reset.txt: point to git-checkout
  git-reset.txt: use "working tree" consistently
  git-reset.txt: reset --soft is not a no-op
  git-reset.txt: reset does not change files in target
  git-reset.txt: clarify branch vs. branch head

13 years agoMerge branch 'tr/send-email-refuse-sending-unedited-cover-letter' into maint
Junio C Hamano [Wed, 24 Nov 2010 20:44:12 +0000 (12:44 -0800)]
Merge branch 'tr/send-email-refuse-sending-unedited-cover-letter' into maint

* tr/send-email-refuse-sending-unedited-cover-letter:
  send-email: Refuse to send cover-letter template subject

13 years agoimap-send: link against libcrypto for HMAC and others
Diego Elio Pettenò [Wed, 24 Nov 2010 20:03:53 +0000 (21:03 +0100)]
imap-send: link against libcrypto for HMAC and others

When using stricter linkers, such as GNU gold or Darwin ld, transitive
dependencies are not counted towards symbol resolution. If we don't link
imap-send to libcrypto, we'll have undefined references to the HMAC_*,
EVP_* and ERR_* functions families.

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-send-email.perl: Deduplicate "to:" and "cc:" entries with names
Joe Perches [Sat, 20 Nov 2010 23:06:05 +0000 (15:06 -0800)]
git-send-email.perl: Deduplicate "to:" and "cc:" entries with names

If an email address in the "to:" list is in the style
"First Last <email@domain.tld>", ie: not just a bare
address like "email@domain.tld", and the same named
entry style exists in the "cc:" list, the current
logic will not remove the entry from the "cc:" list.

Add logic to better deduplicate the "cc:" list by also
matching the email address with angle brackets.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoreflogs: clear flags properly in corner case
Jeff King [Mon, 22 Nov 2010 04:42:53 +0000 (23:42 -0500)]
reflogs: clear flags properly in corner case

The reflog-walking mechanism is based on the regular
revision traversal. We just rewrite the parents of each
commit in fake_reflog_parent to point to the commit in the
next reflog entry instead of the real parents.

However, the regular revision traversal tries not to show
the same commit twice, and so sets the SHOWN flag on each
commit it shows. In a reflog, however, we may want to see
the same commit more than once if it appears in the reflog
multiple times (which easily happens, for example, if you do
a reset to a prior state).

The fake_reflog_parent function takes care of this by
clearing flags, including SHOWN. Unfortunately, it does so
at the very end of the function, and it is possible to
return early from the function if there is no fake parent to
set up (e.g., because we are at the very first reflog entry
on the branch). In such a case the flag is not cleared, and
the entry is skipped by the revision traversal machinery as
already shown.

You can see this by walking the log of a ref which is set to
its very first commit more than once (the test below shows
such a situation). In this case the reflog walk will fail to
show the entry for the initial creation of the ref.

We don't want to simply move the flag-clearing to the top of
the function; we want to make sure flags set during the
fake-parent installation are also cleared. Instead, let's
hoist the flag-clearing out of the fake_reflog_parent
function entirely. It's not really about fake parents
anyway, and the only caller is the get_revision machinery.

Reported-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase --abort: do not update branch ref
Martin von Zweigbergk [Sun, 21 Nov 2010 11:11:21 +0000 (12:11 +0100)]
rebase --abort: do not update branch ref

If a non-interactive rebase of a ref fails at commit X and is aborted by
the user, the ref will be updated twice. First to point at X (with the
reflog message "rebase finished: $head_name onto $onto"), and then back
to $orig_head. It should not be updated at all.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: do not set errno to 0 on success
Erik Faye-Lund [Tue, 23 Nov 2010 19:53:08 +0000 (20:53 +0100)]
mingw: do not set errno to 0 on success

Currently do_lstat always sets errno to 0 on success. This incorrectly
overwrites previous errors.

Fetch the error-code into a temporary variable instead, and assign that
to errno on failure.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agowin32: use our own dirent.h
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:29 +0000 (19:38 +0100)]
win32: use our own dirent.h

The mingw-runtime implemenation of opendir, readdir and closedir
sets errno to 0 on success, something that POSIX explicitly
forbids. 3ba7a06 ("A loose object is not corrupt if it cannot be
read due to EMFILE") introduce a dependency on this behaviour,
leading to a broken "git clone" on Windows.

compat/mingw.c contains an implementation of readdir, and
compat/msvc.c contains implementations of opendir and closedir.

Move these to compat/win32/dirent.[ch], and change to our own DIR
structure at the same time.

This provides a generic Win32-implementation of opendir, readdir
and closedir which works on both MinGW and MSVC and does not reset
errno, and as a result git clone is working again on Windows.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomsvc: opendir: handle paths ending with a slash
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:28 +0000 (19:38 +0100)]
msvc: opendir: handle paths ending with a slash

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agowin32: dirent: handle errors
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:27 +0000 (19:38 +0100)]
win32: dirent: handle errors

Previously all error conditions were ignored. Be nice, and set errno
when we should.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomsvc: opendir: do not start the search
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:26 +0000 (19:38 +0100)]
msvc: opendir: do not start the search

compat/mingw.c's readdir expects to be the one that starts the search,
and if it isn't, then the first entry will be missing or incorrect.

Fix this by removing the call to _findfirst, and initializing dd_handle
to INVALID_HANDLE_VALUE.

At the same time, make sure we use FindClose instead of _findclose,
which is symmetric to readdir's FindFirstFile. Take into account that
the find-handle might already be closed by readdir.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomsvc: opendir: allocate enough memory
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:25 +0000 (19:38 +0100)]
msvc: opendir: allocate enough memory

The defintion of DIR expects the allocating function to extend
dd_name by over-allocating. This is not currently done in our
implementation of opendir. Fix this.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomsvc: opendir: fix malloc-failure
Erik Faye-Lund [Tue, 23 Nov 2010 18:38:24 +0000 (19:38 +0100)]
msvc: opendir: fix malloc-failure

Previsouly, the code checked for malloc-failure after it had accessed
the returned pointer. Move the check a bit earlier to avoid segfault.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'ef/mingw-daemon'
Junio C Hamano [Wed, 24 Nov 2010 00:05:46 +0000 (16:05 -0800)]
Merge branch 'ef/mingw-daemon'

* ef/mingw-daemon:
  daemon: opt-out on features that require posix
  daemon: make --inetd and --detach incompatible
  daemon: use socklen_t
  mingw: use poll-emulation from gnulib
  mingw: import poll-emulation from gnulib
  daemon: get remote host address from root-process
  Improve the mingw getaddrinfo stub to handle more use cases
  daemon: use full buffered mode for stderr
  daemon: use run-command api for async serving
  mingw: add kill emulation
  mingw: support waitpid with pid > 0 and WNOHANG
  mingw: use real pid
  inet_ntop: fix a couple of old-style decls
  compat: add inet_pton and inet_ntop prototypes
  mingw: implement syslog
  mingw: add network-wrappers for daemon

13 years agoformat-patch: page output with --stdout
Tay Ray Chuan [Tue, 23 Nov 2010 03:16:30 +0000 (11:16 +0800)]
format-patch: page output with --stdout

Pass output through the pager if format-patch is run with --stdout. This
saves the user the trouble of running git with '-p' or piping through a
pager.

setup_pager() already checks if stdout is a tty, so we don't have to
worry about behaviour if the user redirects/pipes stdout. Paging can
also be disabled with the config

  [pager]
      format-patch = false

Add tests to check for these behaviour.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: support --verify
Martin von Zweigbergk [Mon, 22 Nov 2010 20:21:01 +0000 (21:21 +0100)]
rebase: support --verify

Interactive rebase allows the '--verify' option to be passed, but it will
be ignored. Implement proper support for the option for both interactive
and non-interactive rebase by making it override any previous
'--no-verify'.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremote-fd/ext: finishing touches after code review
Ilari Liusvaara [Wed, 17 Nov 2010 17:15:34 +0000 (09:15 -0800)]
remote-fd/ext: finishing touches after code review

When compiling with pthread support, transport-helper.c needs to include
necessary header files.  Also fix a few error messages in remote-ext and
remote-fd programs, and a potential buffer underrun in remote-fd.

In the documentation, clarify how %G and %V are used; the old description
looked as if they take repository/vhost parameters, which was wrong.

Also fix AsciiDoc markup for the page title of remote-fd/remote-ext manpages,
and tweak the way how section headers are shown.

Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.4
Junio C Hamano [Thu, 18 Nov 2010 00:43:05 +0000 (16:43 -0800)]
Update draft release notes to 1.7.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jl/maint-pull-tags-doc'
Junio C Hamano [Wed, 17 Nov 2010 23:02:35 +0000 (15:02 -0800)]
Merge branch 'jl/maint-pull-tags-doc'

* jl/maint-pull-tags-doc:
  pull: Remove --tags option from manpage

13 years agoMerge branch 'kb/maint-submodule-savearg'
Junio C Hamano [Wed, 17 Nov 2010 23:02:12 +0000 (15:02 -0800)]
Merge branch 'kb/maint-submodule-savearg'

* kb/maint-submodule-savearg:
  submodule: only preserve flags across recursive status/update invocations
  submodule: preserve all arguments exactly when recursing

13 years agoMerge branch 'jk/missing-config'
Junio C Hamano [Wed, 17 Nov 2010 23:02:08 +0000 (15:02 -0800)]
Merge branch 'jk/missing-config'

* jk/missing-config:
  config: treat non-existent config files as empty

13 years agoMerge branch 'kb/maint-diff-ws-check'
Junio C Hamano [Wed, 17 Nov 2010 23:01:47 +0000 (15:01 -0800)]
Merge branch 'kb/maint-diff-ws-check'

* kb/maint-diff-ws-check:
  diff: handle lines containing only whitespace and tabs better
  test-lib: extend test_decode_color to handle more color codes

13 years agoMerge branch 'bg/maint-gitweb-test-lib'
Junio C Hamano [Wed, 17 Nov 2010 23:01:37 +0000 (15:01 -0800)]
Merge branch 'bg/maint-gitweb-test-lib'

* bg/maint-gitweb-test-lib:
  t/gitweb-lib: Don't pass constant to decode_utf8

Conflicts:
t/gitweb-lib.sh

13 years agoMerge branch 'jm/mailmap'
Junio C Hamano [Wed, 17 Nov 2010 23:01:26 +0000 (15:01 -0800)]
Merge branch 'jm/mailmap'

* jm/mailmap:
  t4203: do not let "git shortlog" DWIM based on tty
  t4203 (mailmap): stop hardcoding commit ids and dates
  mailmap: fix use of freed memory

13 years agoMerge branch 'tr/maint-git-repack-tmpfile'
Junio C Hamano [Wed, 17 Nov 2010 23:01:23 +0000 (15:01 -0800)]
Merge branch 'tr/maint-git-repack-tmpfile'

* tr/maint-git-repack-tmpfile:
  repack: place temporary packs under .git/objects/pack/

13 years agoMerge branch 'jk/maint-apply-no-binary'
Junio C Hamano [Wed, 17 Nov 2010 23:01:18 +0000 (15:01 -0800)]
Merge branch 'jk/maint-apply-no-binary'

* jk/maint-apply-no-binary:
  apply: don't segfault on binary files with missing data

13 years agoMerge branch 'jk/push-progress'
Junio C Hamano [Wed, 17 Nov 2010 23:01:00 +0000 (15:01 -0800)]
Merge branch 'jk/push-progress'

* jk/push-progress:
  push: pass --progress down to git-pack-objects
  t5523-push-upstream: test progress messages
  t5523-push-upstream: add function to ensure fresh upstream repo
  test_terminal: ensure redirections work reliably
  test_terminal: catch use without TTY prerequisite
  test-lib: allow test code to check the list of declared prerequisites
  tests: test terminal output to both stdout and stderr
  tests: factor out terminal handling from t7006

13 years agoMerge branch 'tr/maint-merge-file-subdir'
Junio C Hamano [Wed, 17 Nov 2010 23:00:56 +0000 (15:00 -0800)]
Merge branch 'tr/maint-merge-file-subdir'

* tr/maint-merge-file-subdir:
  merge-file: correctly find files when called in subdir
  prefix_filename(): safely handle the case where pfx_len=0

13 years agoMerge branch 'jn/send-pack-error'
Junio C Hamano [Wed, 17 Nov 2010 23:00:51 +0000 (15:00 -0800)]
Merge branch 'jn/send-pack-error'

* jn/send-pack-error:
  send-pack: avoid redundant "pack-objects died with strange error"

13 years agoMerge branch 'mg/make-prove'
Junio C Hamano [Wed, 17 Nov 2010 23:00:46 +0000 (15:00 -0800)]
Merge branch 'mg/make-prove'

* mg/make-prove:
  test: allow running the tests under "prove"

13 years agoMerge branch 'kb/completion-checkout'
Junio C Hamano [Wed, 17 Nov 2010 23:00:42 +0000 (15:00 -0800)]
Merge branch 'kb/completion-checkout'

* kb/completion-checkout:
  completion: Support the DWIM mode for git checkout

13 years agoMerge branch 'sg/completion'
Junio C Hamano [Wed, 17 Nov 2010 23:00:11 +0000 (15:00 -0800)]
Merge branch 'sg/completion'

* sg/completion:
  bash: support pretty format aliases
  bash: support more 'git notes' subcommands and their options
  bash: not all 'git bisect' subcommands make sense when not bisecting
  bash: offer refs for 'git bisect start'

13 years agoMerge branch 'sg/bisect'
Junio C Hamano [Wed, 17 Nov 2010 23:00:03 +0000 (15:00 -0800)]
Merge branch 'sg/bisect'

* sg/bisect:
  bisect: check for mandatory argument of 'bisect replay'
  bisect: improve error msg of 'bisect reset' when original HEAD is deleted
  bisect: improve error message of 'bisect log' while not bisecting