gitweb.git
Add a regression test for 'git remote add <existing... Johannes Schindelin Tue, 23 Dec 2014 13:25:09 +0000 (14:25 +0100)

Add a regression test for 'git remote add <existing> <same-url>'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git remote: allow adding remotes agreeing with url... Johannes Schindelin Tue, 23 Dec 2014 13:25:05 +0000 (14:25 +0100)

git remote: allow adding remotes agreeing with url.<...>.insteadOf

When adding a remote, we make sure that the remote does not exist
already. However, this test was not quite correct: when the
url.<...>.insteadOf config variable was set to the remote name to be
added, the code would assume that the remote exists already.

Let's allow adding remotes when there is a url.<...>.insteadOf setting
when both the name and the URL agree with the remote to be added.

It might seem like a mistake to compare against remote->url[0] without
verifying that remote->url_nr >=1, but at this point a missing URL has
been filled by the name already, therefore url_nr cannot be zero.

Noticed by Anastas Dancha.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0090: tweak awk statement for Solaris /usr/xpg4/bin/awkBen Walton Mon, 22 Dec 2014 23:25:44 +0000 (15:25 -0800)

t0090: tweak awk statement for Solaris /usr/xpg4/bin/awk

The awk statements previously used in this test weren't compatible
with the native versions of awk on Solaris:

echo "dir" | /bin/awk -v c=0 '$1 {++c} END {print c}'
awk: syntax error near line 1
awk: bailing out near line 1

echo "dir" | /usr/xpg4/bin/awk -v c=0 '$1 {++c} END {print c}'
0

Even though we do not cater to tools in /usr/bin on Solaris that
have and are overridden by corresponding ones in /usr/xpg?/bin,
in this case, even the XPG version does not work correctly.

With GNU awk for comparison:

echo "dir" | /opt/csw/gnu/awk -v c=0 '$1 {++c} END {print c}'
1

which is what this test expects (and is in line with POSIX; non-empty
string is true and an empty string is false).

Work this issue around by using $1 != "" to state more explicitly
that we are skipping empty lines.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ben Walton <bdwalton@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Mon, 22 Dec 2014 20:43:48 +0000 (12:43 -0800)

Sync with maint

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Third batch for 2.3 cycleJunio C Hamano Mon, 22 Dec 2014 20:43:16 +0000 (12:43 -0800)

Third batch for 2.3 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'rs/use-strbuf-complete-line'Junio C Hamano Mon, 22 Dec 2014 20:28:22 +0000 (12:28 -0800)

Merge branch 'rs/use-strbuf-complete-line'

* rs/use-strbuf-complete-line:
use strbuf_complete_line() for adding a newline if needed

Merge branch 'jg/prompt-localize-temporary'Junio C Hamano Mon, 22 Dec 2014 20:28:20 +0000 (12:28 -0800)

Merge branch 'jg/prompt-localize-temporary'

"git-prompt" (in contrib/) used a variable from the global scope,
possibly contaminating end-user's namespace.

* jg/prompt-localize-temporary:
git-prompt.sh: make $f local to __git_eread()

Merge branch 'ch/new-gpg-drops-rfc-1991'Junio C Hamano Mon, 22 Dec 2014 20:28:16 +0000 (12:28 -0800)

Merge branch 'ch/new-gpg-drops-rfc-1991'

Recent GPG changes the keyring format and drops support for RFC1991
formatted signatures, breaking our existing tests.

* ch/new-gpg-drops-rfc-1991:
tests: make comment on GPG keyring match the code
tests: squelch noise from GPG machinery set-up
tests: replace binary GPG keyrings with ASCII-armored keys
tests: skip RFC1991 tests for gnupg 2.1
tests: create gpg homedir on the fly

Merge branch 'jk/commit-date-approxidate'Junio C Hamano Mon, 22 Dec 2014 20:28:14 +0000 (12:28 -0800)

Merge branch 'jk/commit-date-approxidate'

Recent update to "git commit" broke amending an existing commit
with bogus author/committer lines without a valid e-mail address.

* jk/commit-date-approxidate:
commit: always populate GIT_AUTHOR_* variables
commit: loosen ident checks when generating template

Merge branch 'nd/split-index'Junio C Hamano Mon, 22 Dec 2014 20:28:11 +0000 (12:28 -0800)

Merge branch 'nd/split-index'

A typofix to the documentation of a feature already in the release.

* nd/split-index:
index-format.txt: add a missing closing quote

Merge branch 'jk/test-asan'Junio C Hamano Mon, 22 Dec 2014 20:28:08 +0000 (12:28 -0800)

Merge branch 'jk/test-asan'

* jk/test-asan:
t: support clang/gcc AddressSanitizer

Merge branch 'ok/rebase-i-count-todo'Junio C Hamano Mon, 22 Dec 2014 20:28:06 +0000 (12:28 -0800)

Merge branch 'ok/rebase-i-count-todo'

* ok/rebase-i-count-todo:
Show number of TODO items for interactive rebase

Merge branch 'jk/read-packed-refs-without-path-max'Junio C Hamano Mon, 22 Dec 2014 20:28:04 +0000 (12:28 -0800)

Merge branch 'jk/read-packed-refs-without-path-max'

Git did not correctly read an overlong refname from a packed refs
file.

* jk/read-packed-refs-without-path-max:
read_packed_refs: use skip_prefix instead of static array
read_packed_refs: pass strbuf to parse_ref_line
read_packed_refs: use a strbuf for reading lines

Merge branch 'jk/always-allow-large-packets'Junio C Hamano Mon, 22 Dec 2014 20:28:02 +0000 (12:28 -0800)

Merge branch 'jk/always-allow-large-packets'

"git push" and "git fetch" did not communicate an overlong refname
correctly.

* jk/always-allow-large-packets:
pkt-line: allow writing of LARGE_PACKET_MAX buffers

Merge branch 'jk/colors'Junio C Hamano Mon, 22 Dec 2014 20:27:58 +0000 (12:27 -0800)

Merge branch 'jk/colors'

"diff-highlight" filter (in contrib/) allows its color output
to be customized via configuration variables.

* jk/colors:
parse_color: drop COLOR_BACKGROUND macro
diff-highlight: allow configurable colors
parse_color: recognize "no$foo" to clear the $foo attribute
parse_color: support 24-bit RGB values
parse_color: refactor color storage

Merge branch 'rw/apply-does-not-take-ignore-date'Junio C Hamano Mon, 22 Dec 2014 20:27:51 +0000 (12:27 -0800)

Merge branch 'rw/apply-does-not-take-ignore-date'

* rw/apply-does-not-take-ignore-date:
git-am.txt: --ignore-date flag is not passed to git-apply

Merge branch 'js/test-hashmap-squelch-gcc'Junio C Hamano Mon, 22 Dec 2014 20:27:46 +0000 (12:27 -0800)

Merge branch 'js/test-hashmap-squelch-gcc'

* js/test-hashmap-squelch-gcc:
test-hashmap: squelch gcc compiler warning

Merge branch 'js/fsck-tag-validation'Junio C Hamano Mon, 22 Dec 2014 20:27:41 +0000 (12:27 -0800)

Merge branch 'js/fsck-tag-validation'

New tag object format validation added in 2.2 showed garbage
after a tagname it reported in its error message.

* js/fsck-tag-validation:
index-pack: terminate object buffers with NUL
fsck: properly bound "invalid tag name" error message

Merge branch 'po/doc-assume-unchanged'Junio C Hamano Mon, 22 Dec 2014 20:27:38 +0000 (12:27 -0800)

Merge branch 'po/doc-assume-unchanged'

Fixes long-standing misunderstanding of what assume-unchanged is
about. Some text near what is removed by the bottom patch may also
have to be removed.

* po/doc-assume-unchanged:
gitignore.txt: do not suggest assume-unchanged
doc: make clear --assume-unchanged's user contract

Merge branch 'mg/branch-d-m-f'Junio C Hamano Mon, 22 Dec 2014 20:27:36 +0000 (12:27 -0800)

Merge branch 'mg/branch-d-m-f'

"git branch -d" (delete) and "git branch -m" (move) learned to
honor "-f" (force) flag; unlike many other subcommands, the way to
force these have been with separate "-D/-M" options, which was
inconsistent.

* mg/branch-d-m-f:
branch: allow -f with -m and -d
t3200-branch: test -M

Merge branch 'tb/t0027-eol-conversion'Junio C Hamano Mon, 22 Dec 2014 20:27:34 +0000 (12:27 -0800)

Merge branch 'tb/t0027-eol-conversion'

* tb/t0027-eol-conversion:
t0027: check the eol conversion warnings

Merge branch 'jk/for-each-reflog-ent-reverse'Junio C Hamano Mon, 22 Dec 2014 20:27:32 +0000 (12:27 -0800)

Merge branch 'jk/for-each-reflog-ent-reverse'

The code that reads the reflog from the newer to the older entries
did not handle an entry that crosses a boundary of block it uses to
read them correctly.

* jk/for-each-reflog-ent-reverse:
for_each_reflog_ent_reverse: turn leftover check into assertion
for_each_reflog_ent_reverse: fix newlines on block boundaries

Merge branch 'sb/string-list'Junio C Hamano Mon, 22 Dec 2014 20:27:29 +0000 (12:27 -0800)

Merge branch 'sb/string-list'

API simplification.

* sb/string-list:
string_list: remove string_list_insert_at_index() from its API
mailmap: use higher level string list functions
string_list: document string_list_(insert,lookup)

Merge branch 'sv/doc-stripspace'Junio C Hamano Mon, 22 Dec 2014 20:27:27 +0000 (12:27 -0800)

Merge branch 'sv/doc-stripspace'

* sv/doc-stripspace:
Documentation/git-stripspace: add synopsis for --comment-lines

Merge branch 'rt/completion-tag'Junio C Hamano Mon, 22 Dec 2014 20:27:24 +0000 (12:27 -0800)

Merge branch 'rt/completion-tag'

* rt/completion-tag:
completion: add git-tag options

Merge branch 'mg/doc-check-ignore-tracked-are-not-ignored'Junio C Hamano Mon, 22 Dec 2014 20:27:22 +0000 (12:27 -0800)

Merge branch 'mg/doc-check-ignore-tracked-are-not-ignored'

* mg/doc-check-ignore-tracked-are-not-ignored:
check-ignore: clarify treatment of tracked files

Merge branch 'jk/credential-quit'Junio C Hamano Mon, 22 Dec 2014 20:27:19 +0000 (12:27 -0800)

Merge branch 'jk/credential-quit'

Credential helpers are asked in turn until one of them give
positive response, which is cumbersome to turn off when you need to
run Git in an automated setting. The credential helper interface
learned to allow a helper to say "stop, don't ask other helpers."
Also GIT_TERMINAL_PROMPT environment can be set to false to disable
our built-in prompt mechanism for passwords.

* jk/credential-quit:
prompt: respect GIT_TERMINAL_PROMPT to disable terminal prompts
credential: let helpers tell us to quit

Merge branch 'dm/compat-s-ifmt-for-zos'Junio C Hamano Mon, 22 Dec 2014 20:27:16 +0000 (12:27 -0800)

Merge branch 'dm/compat-s-ifmt-for-zos'

Long overdue departure from the assumption that S_IFMT is shared by
everybody made in 2005.

* dm/compat-s-ifmt-for-zos:
compat: convert modes to use portable file type values

Merge branch 'ps/new-workdir-into-empty-directory'Junio C Hamano Mon, 22 Dec 2014 20:27:13 +0000 (12:27 -0800)

Merge branch 'ps/new-workdir-into-empty-directory'

"git new-workdir" (in contrib/) can be used to populate an empty
and existing directory now.

* ps/new-workdir-into-empty-directory:
git-new-workdir: don't fail if the target directory is empty

Merge branch 'nd/ls-tree-pathspec'Junio C Hamano Mon, 22 Dec 2014 20:27:12 +0000 (12:27 -0800)

Merge branch 'nd/ls-tree-pathspec'

"git ls-tree" does not support path selection based on negative
pathspecs, but did not error out when negative pathspecs are given.

* nd/ls-tree-pathspec:
t3102: style modernization
t3102: document that ls-tree does not yet support negated pathspec
ls-tree: disable negative pathspec because it's not supported
ls-tree: remove path filtering logic in show_tree
tree.c: update read_tree_recursive callback to pass strbuf as base

Merge branch 'jc/hook-cleanup'Junio C Hamano Mon, 22 Dec 2014 20:27:10 +0000 (12:27 -0800)

Merge branch 'jc/hook-cleanup'

Remove unused code.

* jc/hook-cleanup:
run-command.c: retire unused run_hook_with_custom_index()

Merge branch 'rt/for-each-ref-spell-tcl-as-Tcl'Junio C Hamano Mon, 22 Dec 2014 20:27:08 +0000 (12:27 -0800)

Merge branch 'rt/for-each-ref-spell-tcl-as-Tcl'

* rt/for-each-ref-spell-tcl-as-Tcl:
for-each-ref: correct spelling of Tcl in option description

Merge branch 'rj/t0050-passes'Junio C Hamano Mon, 22 Dec 2014 20:27:06 +0000 (12:27 -0800)

Merge branch 'rj/t0050-passes'

* rj/t0050-passes:
t0050-*.sh: mark the rename (case change) test as passing

Merge branch 'js/push-to-deploy'Junio C Hamano Mon, 22 Dec 2014 20:27:03 +0000 (12:27 -0800)

Merge branch 'js/push-to-deploy'

"git push" into a repository with a working tree normally refuses
to modify the branch that is checked out. The command learned to
optionally do an equivalent of "git reset --hard" only when there
is no change to the working tree and the index instead, which would
be useful to "deploy" by pushing into a repository.

* js/push-to-deploy:
t5516: more tests for receive.denyCurrentBranch=updateInstead
receive-pack: add another option for receive.denyCurrentBranch

Merge branch 'jc/exec-cmd-system-path-leak-fix'Junio C Hamano Mon, 22 Dec 2014 20:27:01 +0000 (12:27 -0800)

Merge branch 'jc/exec-cmd-system-path-leak-fix'

The function sometimes returned a non-freeable memory and some
other times returned a piece of memory that must be freed.

* jc/exec-cmd-system-path-leak-fix:
system_path(): always return free'able memory to the caller

Merge branch 'mh/find-uniq-abbrev'Junio C Hamano Mon, 22 Dec 2014 20:26:57 +0000 (12:26 -0800)

Merge branch 'mh/find-uniq-abbrev'

The code to abbreviate an object name to its short unique prefix
has been optimized when no abbreviation was requested.

* mh/find-uniq-abbrev:
sha1_name: avoid unnecessary sha1 lookup in find_unique_abbrev

Merge branch 'pb/send-email-te'Junio C Hamano Mon, 22 Dec 2014 20:26:53 +0000 (12:26 -0800)

Merge branch 'pb/send-email-te'

"git send-email" learned "--transfer-encoding" option to force
a non-fault Content-Transfer-Encoding header (e.g. base64).

* pb/send-email-te:
git-send-email: add --transfer-encoding option
git-send-email: delay creation of MIME headers

Merge branch 'pb/am-message-id-footer'Junio C Hamano Mon, 22 Dec 2014 20:26:52 +0000 (12:26 -0800)

Merge branch 'pb/am-message-id-footer'

"git am" learned "--message-id" option to copy the message ID of
the incoming e-mail to the log message of resulting commit.

* pb/am-message-id-footer:
git-am: add --message-id/--no-message-id
git-mailinfo: add --message-id

Merge branch 'mh/simplify-repack-without-refs'Junio C Hamano Mon, 22 Dec 2014 20:26:50 +0000 (12:26 -0800)

Merge branch 'mh/simplify-repack-without-refs'

"git remote update --prune" to drop many refs has been optimized.

* mh/simplify-repack-without-refs:
sort_string_list(): rename to string_list_sort()
prune_remote(): iterate using for_each_string_list_item()
prune_remote(): rename local variable
repack_without_refs(): make the refnames argument a string_list
prune_remote(): sort delete_refs_list references en masse
prune_remote(): initialize both delete_refs lists in a single loop
prune_remote(): exit early if there are no stale references

Merge branch 'dw/shell-basename-dashdash-before-strippi... Junio C Hamano Mon, 22 Dec 2014 20:26:48 +0000 (12:26 -0800)

Merge branch 'dw/shell-basename-dashdash-before-stripping-leading-dash-from-login'

* dw/shell-basename-dashdash-before-stripping-leading-dash-from-login:
git-sh-setup.sh: use dashdash with basename call

Merge branch 'rj/no-xopen-source-for-cygwin'Junio C Hamano Mon, 22 Dec 2014 20:26:45 +0000 (12:26 -0800)

Merge branch 'rj/no-xopen-source-for-cygwin'

Avoid compilation warnings on recent gcc toolchain on Cygwin.

* rj/no-xopen-source-for-cygwin:
git-compat-util.h: don't define _XOPEN_SOURCE on cygwin

Merge branch 'js/t5000-dont-copy-bin-sh'Junio C Hamano Mon, 22 Dec 2014 20:26:43 +0000 (12:26 -0800)

Merge branch 'js/t5000-dont-copy-bin-sh'

* js/t5000-dont-copy-bin-sh:
t5000 on Windows: do not mistake "sh.exe" as "sh"

Merge branch 'jc/refer-to-t-readme-from-submitting... Junio C Hamano Mon, 22 Dec 2014 20:26:38 +0000 (12:26 -0800)

Merge branch 'jc/refer-to-t-readme-from-submitting-patches'

* jc/refer-to-t-readme-from-submitting-patches:
t/README: justify why "! grep foo" is sufficient
SubmittingPatches: refer to t/README for tests

Merge branch 'tb/config-core-filemode-check-on-broken-fs'Junio C Hamano Mon, 22 Dec 2014 20:26:33 +0000 (12:26 -0800)

Merge branch 'tb/config-core-filemode-check-on-broken-fs'

Some filesystems assign filemodes in a strange way, fooling then
automatic "filemode trustability" check done during a new
repository creation.

* tb/config-core-filemode-check-on-broken-fs:
init-db: improve the filemode trustability check

Merge branch 'mg/add-ignore-errors'Junio C Hamano Mon, 22 Dec 2014 20:26:30 +0000 (12:26 -0800)

Merge branch 'mg/add-ignore-errors'

"git add --ignore-errors ..." did not ignore an error to
give a file that did not exist.

* mg/add-ignore-errors:
add: ignore only ignored files

Merge branch 'jk/lock-ref-sha1-basic-return-errors'Junio C Hamano Mon, 22 Dec 2014 20:26:27 +0000 (12:26 -0800)

Merge branch 'jk/lock-ref-sha1-basic-return-errors'

Correct an API anomaly.

* jk/lock-ref-sha1-basic-return-errors:
lock_ref_sha1_basic: do not die on locking errors

Merge branch 'cc/interpret-trailers-more'Junio C Hamano Mon, 22 Dec 2014 20:26:23 +0000 (12:26 -0800)

Merge branch 'cc/interpret-trailers-more'

"git interpret-trailers" learned to properly handle the
"Conflicts:" block at the end.

* cc/interpret-trailers-more:
trailer: add test with an old style conflict block
trailer: reuse ignore_non_trailer() to ignore conflict lines
commit: make ignore_non_trailer() non static
merge & sequencer: turn "Conflicts:" hint into a comment
builtin/commit.c: extract ignore_non_trailer() helper function
merge & sequencer: unify codepaths that write "Conflicts:" hint
builtin/merge.c: drop a parameter that is never used

Prepare for 2.2.2Junio C Hamano Mon, 22 Dec 2014 20:20:38 +0000 (12:20 -0800)

Prepare for 2.2.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jk/rebuild-perl-scripts-with-no-perl... Junio C Hamano Mon, 22 Dec 2014 20:18:35 +0000 (12:18 -0800)

Merge branch 'jk/rebuild-perl-scripts-with-no-perl-seting-change' into maint

The build procedure did not bother fixing perl and python scripts
when NO_PERL and NO_PYTHON build-time configuration changed.

* jk/rebuild-perl-scripts-with-no-perl-seting-change:
Makefile: have python scripts depend on NO_PYTHON setting
Makefile: simplify by using SCRIPT_{PERL,SH}_GEN macros
Makefile: have perl scripts depend on NO_PERL setting

Merge branch 'jk/no-perl-tests' into maintJunio C Hamano Mon, 22 Dec 2014 20:18:25 +0000 (12:18 -0800)

Merge branch 'jk/no-perl-tests' into maint

Some tests that depend on perl lacked PERL prerequisite to protect
them, breaking build with NO_PERL configuration.

* jk/no-perl-tests:
t960[34]: mark cvsimport tests as requiring perl
t0090: mark add-interactive test with PERL prerequisite

Merge branch 'po/everyday-doc' into maintJunio C Hamano Mon, 22 Dec 2014 20:18:16 +0000 (12:18 -0800)

Merge branch 'po/everyday-doc' into maint

"Everyday" document had a broken link.

* po/everyday-doc:
Documentation: change "gitlink" typo in git-push

Merge branch 'jk/push-simple' into maintJunio C Hamano Mon, 22 Dec 2014 20:18:08 +0000 (12:18 -0800)

Merge branch 'jk/push-simple' into maint

Git 2.0 was supposed to make the "simple" mode for the default of
"git push", but it didn't.

* jk/push-simple:
push: truly use "simple" as default, not "upstream"

Merge branch 'mh/config-flip-xbit-back-after-checking... Junio C Hamano Mon, 22 Dec 2014 20:18:00 +0000 (12:18 -0800)

Merge branch 'mh/config-flip-xbit-back-after-checking' into maint

"git init" (hence "git clone") initialized the per-repository
configuration file .git/config with x-bit by mistake.

* mh/config-flip-xbit-back-after-checking:
create_default_files(): don't set u+x bit on $GIT_DIR/config

Merge branch 'jk/gitweb-with-newer-cgi-multi-param... Junio C Hamano Mon, 22 Dec 2014 20:17:34 +0000 (12:17 -0800)

Merge branch 'jk/gitweb-with-newer-cgi-multi-param' into maint

"gitweb" used to depend on a behaviour that was deprecated by recent
CGI.pm.

* jk/gitweb-with-newer-cgi-multi-param:
gitweb: hack around CGI's list-context param() handling

Merge branch 'rs/receive-pack-use-labs' into maintJunio C Hamano Mon, 22 Dec 2014 20:17:32 +0000 (12:17 -0800)

Merge branch 'rs/receive-pack-use-labs' into maint

* rs/receive-pack-use-labs:
use labs() for variables of type long instead of abs()

Merge branch 'rs/maint-config-use-labs' into maintJunio C Hamano Mon, 22 Dec 2014 20:17:23 +0000 (12:17 -0800)

Merge branch 'rs/maint-config-use-labs' into maint

* rs/maint-config-use-labs:
use labs() for variables of type long instead of abs()

Merge branch 'js/windows-open-eisdir-error' into maintJunio C Hamano Mon, 22 Dec 2014 20:17:13 +0000 (12:17 -0800)

Merge branch 'js/windows-open-eisdir-error' into maint

open() emulated on Windows platforms did not give EISDIR upon an
attempt to open a directory for writing.

* js/windows-open-eisdir-error:
Windows: correct detection of EISDIR in mingw_open()

Merge branch 'jk/colors-fix' into maintJunio C Hamano Mon, 22 Dec 2014 20:16:58 +0000 (12:16 -0800)

Merge branch 'jk/colors-fix' into maint

"git config --get-color" did not parse its command line arguments
carefully.

* jk/colors-fix:
t4026: test "normal" color
config: fix parsing of "git config --get-color some.key -1"
docs: describe ANSI 256-color mode

Merge branch 'jk/checkout-from-tree' into maintJunio C Hamano Mon, 22 Dec 2014 20:16:29 +0000 (12:16 -0800)

Merge branch 'jk/checkout-from-tree' into maint

"git checkout $treeish $path", when $path in the index and the
working tree already matched what is in $treeish at the $path,
still overwrote the $path unnecessarily.

* jk/checkout-from-tree:
checkout $tree: do not throw away unchanged index entries

Documentation: add missing article in rev-list-options.txtbrian m. carlson Sat, 20 Dec 2014 22:51:11 +0000 (22:51 +0000)

Documentation: add missing article in rev-list-options.txt

Add the missing article "a".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-prompt: preserve value of $? inside shell promptTony Finch Mon, 22 Dec 2014 18:09:25 +0000 (18:09 +0000)

git-prompt: preserve value of $? inside shell prompt

If you have a prompt which displays the command exit status,
__git_ps1 without this change corrupts it, although it has
the correct value in the parent shell:

~/src/git (master) 0 $ set | grep ^PS1
PS1='\w$(__git_ps1) $? \$ '
~/src/git (master) 0 $ false
~/src/git (master) 0 $ echo $?
1
~/src/git (master) 0 $

There is a slightly ugly workaround:

~/src/git (master) 0 $ set | grep ^PS1
PS1='\w$(x=$?; __git_ps1; exit $x) $? \$ '
~/src/git (master) 0 $ false
~/src/git (master) 1 $

This change makes the workaround unnecessary.

Signed-off-by: Tony Finch <dot@dotat.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pre-push.sample: remove unnecessary and misleading... Jim Hill Sun, 21 Dec 2014 19:26:00 +0000 (11:26 -0800)

pre-push.sample: remove unnecessary and misleading IFS=' '

The sample hook explicitly sets IFS to SP and nothing else so that
the "read" used in the per-ref while loop that iterates over
"<localref> SP <localsha1> SP <remoteref> SP <remotesha>" records,
where we know refs and sha1s will not have SPs, would split them
correctly.

While this is not wrong per-se, it is not necessary; because we know
these fields do not contain HT or LF, either, we can simply leave
IFS the default.

This will also prevent those who cut and paste from this sample from
getting bitten when they write things in the per-ref loop that need
splitting with the default $IFS (e.g. use $(git rev-list ...) to
produce one-record-per-line output).

Signed-off-by: Jim Hill <gjthill@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update_unicode.sh: delete the command groupBeat Bolli Fri, 19 Dec 2014 16:24:24 +0000 (17:24 +0100)

update_unicode.sh: delete the command group

Now that the whole file is generated by one single command, the
command group is no longer needed.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update_unicode.sh: make the output structure visibleBeat Bolli Fri, 19 Dec 2014 16:24:23 +0000 (17:24 +0100)

update_unicode.sh: make the output structure visible

By using a here document instead of the echo/uniset sequence, the
final structure of the generated file becomes obvious.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update_unicode.sh: shorten uniset invocation pathBeat Bolli Fri, 19 Dec 2014 16:24:22 +0000 (17:24 +0100)

update_unicode.sh: shorten uniset invocation path

"uniset/uniset" is a relative path; there's no need to prefix it
with "./".

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update_unicode.sh: set UNICODE_DIR only onceBeat Bolli Fri, 19 Dec 2014 16:24:21 +0000 (17:24 +0100)

update_unicode.sh: set UNICODE_DIR only once

The value is the same on both uniset invocations, so "Don't Repeat
Yourself" applies.

Since this is done as the last command in the sequence, there's no
need to unset UNICODE_DIR at the end.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update_unicode.sh: simplify output captureBeat Bolli Fri, 19 Dec 2014 16:24:20 +0000 (17:24 +0100)

update_unicode.sh: simplify output capture

Instead of capturing the output of each echo and uniset invocation,
wrap the whole section in a group command and redirect its output
all at once.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clean: typofixAlexander Kuleshov Fri, 19 Dec 2014 08:37:47 +0000 (14:37 +0600)

clean: typofix

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/SubmittingPatches: unify whitespace/tabs... Stefan Beller Thu, 18 Dec 2014 01:08:15 +0000 (17:08 -0800)

Documentation/SubmittingPatches: unify whitespace/tabs for the DCO

The Developers Certificate of Origin has a mixture of tabs and white
spaces which is annoying to view if your editor explicitly views white
space characters.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v2.2.1Junio C Hamano Thu, 18 Dec 2014 20:30:53 +0000 (12:30 -0800)

Sync with v2.2.1

* maint:
Git 2.2.1
Git 2.1.4
Git 2.0.5
Git 1.9.5
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

git-compat-util: suppress unavoidable Apple-specific... Eric Sunshine Tue, 16 Dec 2014 23:19:36 +0000 (18:19 -0500)

git-compat-util: suppress unavoidable Apple-specific deprecation warnings

With the release of Mac OS X 10.7 in July 2011, Apple deprecated all
openssl.h functionality due to OpenSSL ABI (application binary
interface) instability, resulting in an explosion of compilation
warnings about deprecated SSL, SHA1, and X509 functions (among others).

61067954ce (cache.h: eliminate SHA-1 deprecation warnings on Mac OS X;
2013-05-19) and be4c828b76 (imap-send: eliminate HMAC deprecation
warnings on Mac OS X; 2013-05-19) attempted to ameliorate the situation
by taking advantage of drop-in replacement functionality provided by
Apple's (ABI-stable) CommonCrypto facility, however CommonCrypto
supplies only a subset of deprecated OpenSSL functionality, thus a host
of warnings remain.

Despite this shortcoming, it was hoped that Apple would ultimately
provide CommonCrypto replacements for all deprecated OpenSSL
functionality, and that the effort started by 61067954ce and be4c828b76
would be continued and eventually eliminate all deprecation warnings.
However, now 3.5 years later, and with Mac OS X at 10.10, the hoped-for
CommonCrypto replacements have not yet materialized, nor is there any
indication that they will be forthcoming.

These Apple-specific warnings are pure noise: they don't tell us
anything useful and we have no control over them, nor is Apple likely to
provide replacements any time soon. Such noise may obscure other
legitimate warnings, therefore silence them.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.2.1 v2.2.1Junio C Hamano Wed, 17 Dec 2014 19:49:34 +0000 (11:49 -0800)

Git 2.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v2.1.4Junio C Hamano Wed, 17 Dec 2014 19:46:57 +0000 (11:46 -0800)

Sync with v2.1.4

* maint-2.1:
Git 2.1.4
Git 2.0.5
Git 1.9.5
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

Git 2.1.4 v2.1.4Junio C Hamano Wed, 17 Dec 2014 19:44:59 +0000 (11:44 -0800)

Git 2.1.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v2.0.5Junio C Hamano Wed, 17 Dec 2014 19:42:28 +0000 (11:42 -0800)

Sync with v2.0.5

* maint-2.0:
Git 2.0.5
Git 1.9.5
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

Git 2.0.5 v2.0.5Junio C Hamano Wed, 17 Dec 2014 19:30:46 +0000 (11:30 -0800)

Git 2.0.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v1.9.5Junio C Hamano Wed, 17 Dec 2014 19:28:02 +0000 (11:28 -0800)

Sync with v1.9.5

* maint-1.9:
Git 1.9.5
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

Git 1.9.5 v1.9.5Junio C Hamano Wed, 17 Dec 2014 19:22:32 +0000 (11:22 -0800)

Git 1.9.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with v1.8.5.6Junio C Hamano Wed, 17 Dec 2014 19:20:31 +0000 (11:20 -0800)

Sync with v1.8.5.6

* maint-1.8.5:
Git 1.8.5.6
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

Git 1.8.5.6 v1.8.5.6Junio C Hamano Wed, 17 Dec 2014 19:18:45 +0000 (11:18 -0800)

Git 1.8.5.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'dotgit-case-maint-1.8.5' into maint-1.8.5Junio C Hamano Wed, 17 Dec 2014 19:11:15 +0000 (11:11 -0800)

Merge branch 'dotgit-case-maint-1.8.5' into maint-1.8.5

* dotgit-case-maint-1.8.5:
fsck: complain about NTFS ".git" aliases in trees
read-cache: optionally disallow NTFS .git variants
path: add is_ntfs_dotgit() helper
fsck: complain about HFS+ ".git" aliases in trees
read-cache: optionally disallow HFS+ .git variants
utf8: add is_hfs_dotgit() helper
fsck: notice .git case-insensitively
t1450: refactor ".", "..", and ".git" fsck tests
verify_dotfile(): reject .git case-insensitively
read-tree: add tests for confusing paths like ".." and ".git"
unpack-trees: propagate errors adding entries to the index

fsck: complain about NTFS ".git" aliases in treesJohannes Schindelin Wed, 10 Dec 2014 21:28:27 +0000 (22:28 +0100)

fsck: complain about NTFS ".git" aliases in trees

Now that the index can block pathnames that can be mistaken
to mean ".git" on NTFS and FAT32, it would be helpful for
fsck to notice such problematic paths. This lets servers
which use receive.fsckObjects block them before the damage
spreads.

Note that the fsck check is always on, even for systems
without core.protectNTFS set. This is technically more
restrictive than we need to be, as a set of users on ext4
could happily use these odd filenames without caring about
NTFS.

However, on balance, it's helpful for all servers to block
these (because the paths can be used for mischief, and
servers which bother to fsck would want to stop the spread
whether they are on NTFS themselves or not), and hardly
anybody will be affected (because the blocked names are
variants of .git or git~1, meaning mischief is almost
certainly what the tree author had in mind).

Ideally these would be controlled by a separate
"fsck.protectNTFS" flag. However, it would be much nicer to
be able to enable/disable _any_ fsck flag individually, and
any scheme we choose should match such a system. Given the
likelihood of anybody using such a path in practice, it is
not unreasonable to wait until such a system materializes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache: optionally disallow NTFS .git variantsJohannes Schindelin Tue, 16 Dec 2014 22:46:59 +0000 (23:46 +0100)

read-cache: optionally disallow NTFS .git variants

The point of disallowing ".git" in the index is that we
would never want to accidentally overwrite files in the
repository directory. But this means we need to respect the
filesystem's idea of when two paths are equal. The prior
commit added a helper to make such a comparison for NTFS
and FAT32; let's use it in verify_path().

We make this check optional for two reasons:

1. It restricts the set of allowable filenames, which is
unnecessary for people who are not on NTFS nor FAT32.
In practice this probably doesn't matter, though, as
the restricted names are rather obscure and almost
certainly would never come up in practice.

2. It has a minor performance penalty for every path we
insert into the index.

This patch ties the check to the core.protectNTFS config
option. Though this is expected to be most useful on Windows,
we allow it to be set everywhere, as NTFS may be mounted on
other platforms. The variable does default to on for Windows,
though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

path: add is_ntfs_dotgit() helperJohannes Schindelin Tue, 16 Dec 2014 22:31:03 +0000 (23:31 +0100)

path: add is_ntfs_dotgit() helper

We do not allow paths with a ".git" component to be added to
the index, as that would mean repository contents could
overwrite our repository files. However, asking "is this
path the same as .git" is not as simple as strcmp() on some
filesystems.

On NTFS (and FAT32), there exist so-called "short names" for
backwards-compatibility: 8.3 compliant names that refer to the same files
as their long names. As ".git" is not an 8.3 compliant name, a short name
is generated automatically, typically "git~1".

Depending on the Windows version, any combination of trailing spaces and
periods are ignored, too, so that both "git~1." and ".git." still refer
to the Git directory. The reason is that 8.3 stores file names shorter
than 8 characters with trailing spaces. So literally, it does not matter
for the short name whether it is padded with spaces or whether it is
shorter than 8 characters, it is considered to be the exact same.

The period is the separator between file name and file extension, and
again, an empty extension consists just of spaces in 8.3 format. So
technically, we would need only take care of the equivalent of this
regex:
(\.git {0,4}|git~1 {0,3})\. {0,3}

However, there are indications that at least some Windows versions might
be more lenient and accept arbitrary combinations of trailing spaces and
periods and strip them out. So we're playing it real safe here. Besides,
there can be little doubt about the intention behind using file names
matching even the more lenient pattern specified above, therefore we
should be fine with disallowing such patterns.

Extra care is taken to catch names such as '.\\.git\\booh' because the
backslash is marked as a directory separator only on Windows, and we want
to use this new helper function also in fsck on other platforms.

A big thank you goes to Ed Thomson and an unnamed Microsoft engineer for
the detailed analysis performed to come up with the corresponding fixes
for libgit2.

This commit adds a function to detect whether a given file name can refer
to the Git directory by mistake.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: complain about HFS+ ".git" aliases in treesJeff King Mon, 15 Dec 2014 23:21:57 +0000 (18:21 -0500)

fsck: complain about HFS+ ".git" aliases in trees

Now that the index can block pathnames that case-fold to
".git" on HFS+, it would be helpful for fsck to notice such
problematic paths. This lets servers which use
receive.fsckObjects block them before the damage spreads.

Note that the fsck check is always on, even for systems
without core.protectHFS set. This is technically more
restrictive than we need to be, as a set of users on ext4
could happily use these odd filenames without caring about
HFS+.

However, on balance, it's helpful for all servers to block
these (because the paths can be used for mischief, and
servers which bother to fsck would want to stop the spread
whether they are on HFS+ themselves or not), and hardly
anybody will be affected (because the blocked names are
variants of .git with invisible Unicode code-points mixed
in, meaning mischief is almost certainly what the tree
author had in mind).

Ideally these would be controlled by a separate
"fsck.protectHFS" flag. However, it would be much nicer to
be able to enable/disable _any_ fsck flag individually, and
any scheme we choose should match such a system. Given the
likelihood of anybody using such a path in practice, it is
not unreasonable to wait until such a system materializes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache: optionally disallow HFS+ .git variantsJeff King Mon, 15 Dec 2014 23:15:20 +0000 (18:15 -0500)

read-cache: optionally disallow HFS+ .git variants

The point of disallowing ".git" in the index is that we
would never want to accidentally overwrite files in the
repository directory. But this means we need to respect the
filesystem's idea of when two paths are equal. The prior
commit added a helper to make such a comparison for HFS+;
let's use it in verify_path.

We make this check optional for two reasons:

1. It restricts the set of allowable filenames, which is
unnecessary for people who are not on HFS+. In practice
this probably doesn't matter, though, as the restricted
names are rather obscure and almost certainly would
never come up in practice.

2. It has a minor performance penalty for every path we
insert into the index.

This patch ties the check to the core.protectHFS config
option. Though this is expected to be most useful on OS X,
we allow it to be set everywhere, as HFS+ may be mounted on
other platforms. The variable does default to on for OS X,
though.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

utf8: add is_hfs_dotgit() helperJeff King Mon, 15 Dec 2014 22:56:59 +0000 (17:56 -0500)

utf8: add is_hfs_dotgit() helper

We do not allow paths with a ".git" component to be added to
the index, as that would mean repository contents could
overwrite our repository files. However, asking "is this
path the same as .git" is not as simple as strcmp() on some
filesystems.

HFS+'s case-folding does more than just fold uppercase into
lowercase (which we already handle with strcasecmp). It may
also skip past certain "ignored" Unicode code points, so
that (for example) ".gi\u200ct" is mapped ot ".git".

The full list of folds can be found in the tables at:

https://www.opensource.apple.com/source/xnu/xnu-1504.15.3/bsd/hfs/hfscommon/Unicode/UCStringCompareData.h

Implementing a full "is this path the same as that path"
comparison would require us importing the whole set of
tables. However, what we want to do is much simpler: we
only care about checking ".git". We know that 'G' is the
only thing that folds to 'g', and so on, so we really only
need to deal with the set of ignored code points, which is
much smaller.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsck: notice .git case-insensitivelyJeff King Mon, 24 Nov 2014 18:40:44 +0000 (13:40 -0500)

fsck: notice .git case-insensitively

We complain about ".git" in a tree because it cannot be
loaded into the index or checked out. Since we now also
reject ".GIT" case-insensitively, fsck should notice the
same, so that errors do not propagate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1450: refactor ".", "..", and ".git" fsck testsJeff King Mon, 24 Nov 2014 18:40:11 +0000 (13:40 -0500)

t1450: refactor ".", "..", and ".git" fsck tests

We check that fsck notices and complains about confusing
paths in trees. However, there are a few shortcomings:

1. We check only for these paths as file entries, not as
intermediate paths (so ".git" and not ".git/foo").

2. We check "." and ".." together, so it is possible that
we notice only one and not the other.

3. We repeat a lot of boilerplate.

Let's use some loops to be more thorough in our testing, and
still end up with shorter code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

verify_dotfile(): reject .git case-insensitivelyJeff King Mon, 24 Nov 2014 18:39:12 +0000 (13:39 -0500)

verify_dotfile(): reject .git case-insensitively

We do not allow ".git" to enter into the index as a path
component, because checking out the result to the working
tree may causes confusion for subsequent git commands.
However, on case-insensitive file systems, ".Git" or ".GIT"
is the same. We should catch and prevent those, too.

Note that technically we could allow this for repos on
case-sensitive filesystems. But there's not much point. It's
unlikely that anybody cares, and it creates a repository
that is unexpectedly non-portable to other systems.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-tree: add tests for confusing paths like ".."... Jeff King Mon, 24 Nov 2014 18:37:56 +0000 (13:37 -0500)

read-tree: add tests for confusing paths like ".." and ".git"

We should prevent nonsense paths from entering the index in
the first place, as they can cause confusing results if they
are ever checked out into the working tree. We already do
so, but we never tested it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: propagate errors adding entries to the... Jeff King Mon, 24 Nov 2014 18:36:51 +0000 (13:36 -0500)

unpack-trees: propagate errors adding entries to the index

When unpack_trees tries to write an entry to the index,
add_index_entry may report an error to stderr, but we ignore
its return value. This leads to us returning a successful
exit code for an operation that partially failed. Let's make
sure to propagate this code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: make comment on GPG keyring match the codeChristian Hesse Tue, 16 Dec 2014 08:40:05 +0000 (09:40 +0100)

tests: make comment on GPG keyring match the code

GnuPG homedir is generated on the fly and keys are imported from
armored key file. Make comment match available key info and new key
generation procedure.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5400: remove dead codeStefan Beller Tue, 16 Dec 2014 03:58:07 +0000 (19:58 -0800)

t5400: remove dead code

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test/send-email: --[no-]xmailer testsLuis Henriques Thu, 4 Dec 2014 19:11:30 +0000 (19:11 +0000)

test/send-email: --[no-]xmailer tests

Add tests for the --[no-]xmailer option.

Signed-off-by: Luis Henriques <henrix@camandro.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: add --[no-]xmailer optionLuis Henriques Mon, 24 Mar 2014 21:38:27 +0000 (21:38 +0000)

send-email: add --[no-]xmailer option

Add --[no-]xmailer that allows a user to disable adding the 'X-Mailer:'
header to the email being sent.

Signed-off-by: Luis Henriques <henrix@camandro.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add--interactive: leave main loop on read errorJeff King Mon, 15 Dec 2014 16:35:27 +0000 (11:35 -0500)

add--interactive: leave main loop on read error

The main hunk loop for add--interactive will loop if it does
not get a known input. This is a good thing if the user
typed some invalid input. However, if we have an
uncorrectable read error, we'll end up looping infinitely.
We can fix this by noticing read errors (i.e., <STDIN>
returns undef) and breaking out of the loop.

One easy way to trigger this is if you have an editor that
does not take over the terminal (e.g., one that spawns a
window in an existing process and waits), start the editor
with the hunk-edit command, and hit ^C to send SIGINT. The
editor process dies due to SIGINT, but the perl
add--interactive process does not (perl suspends SIGINT for
the duration of our system() call).

We return to the main loop, but further reads from stdin
don't work. The SIGINT _also_ killed our parent git process,
which orphans our process group, meaning that further reads
from the terminal will always fail. We loop infinitely,
getting EIO on each read.

Note that there are several other spots where we read from
stdin, too. However, in each of those cases, we do something
sane when the read returns undef (breaking out of the loop,
taking the input as "no", etc). They don't need similar
treatment.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update documentation occurrences of filename .shPeter van der Does Mon, 15 Dec 2014 14:34:28 +0000 (09:34 -0500)

Update documentation occurrences of filename .sh

Documentation in the completion scripts for Bash and Zsh state the wrong filenames.

Signed-off-by: Peter van der Does <peter@avirtualhome.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: handle adjacent RFC 2047-encoded words... Роман Донченко Sun, 14 Dec 2014 15:59:47 +0000 (18:59 +0300)

send-email: handle adjacent RFC 2047-encoded words properly

The RFC says that they are to be concatenated after decoding (i.e. the
intervening whitespace is ignored).

Signed-off-by: Роман Донченко <dpb@corrigendum.ru>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: align RFC 2047 decoding more closely with... Роман Донченко Sun, 14 Dec 2014 15:59:46 +0000 (18:59 +0300)

send-email: align RFC 2047 decoding more closely with the spec

More specifically:

* Add "\" to the list of characters not allowed in a token (see RFC 2047
errata).

* Share regexes between unquote_rfc2047 and is_rfc2047_quoted. Besides
removing duplication, this also makes unquote_rfc2047 more stringent.

* Allow both "q" and "Q" to identify the encoding.

* Allow lowercase hexadecimal digits in the "Q" encoding.

And, more on the cosmetic side:

* Change the "encoded-text" regex to exclude rather than include characters,
for clarity and consistency with "token".

Signed-off-by: Роман Донченко <dpb@corrigendum.ru>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>