diff: accept --no-follow option

Once you do

	$ alias glogone git log --follow

there is no way to say

	$ glogone --no-follow ...

Not that "log --follow" is all that useful, but it is cheap to
support the common "you can defeat an undesirable option with a
'no-' variant of it later on the command line" pattern.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
blame: pay attention to --no-follow

If you know your history did not have renames, or if you care only
about the history after a large rename that happened some time ago,
"git blame --no-follow $path" is a way to tell the command not to
bother about renames.

When you use -C, the lines that came from the renamed file will
still be found without the whole-file rename detection, so it is not
all that interesting either way, though.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote-testgit: properly check for errors

'feature done' was missing, which allowed fast-import exit properly, and
transport-helper to continue checking for refs and what not when in fact
the remote-helper died.

Let's enable that, and make sure the error paths are triggered.

Now transport-helper correctly detects the errors from fast-import,
unfortunately, not from fast-export because it might finish before
detecting a SIGPIPE. This means transport-helper will quit silently and
the user will not see any errors, which is bad. Hopefully the helper
will print the error before dying anyway, so not all is lost.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
dir.c: Make git-status --ignored more consistent

The current behavior of git-status is inconsistent and misleading.
Especially when used with --untracked-files=all option:

 - files ignored in untracked directories will be missing from
   status output.

 - untracked files in committed yet ignored directories are also
   missing.

 - with --untracked-files=normal, untracked directories that
   contains only ignored files are dropped too.

Make the behavior more consistent across all possible use cases:

 - "--ignored --untracked-files=normal" doesn't show each specific
   files but top directory.  It instead shows untracked directories
   that only contains ignored files, and ignored tracked directories
   with untracked files.

 - "--ignored --untracked-files=all" shows all ignored files, either
   because it's in an ignored directory (tracked or untracked), or
   because the file is explicitly ignored.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-status: Test --ignored behavior

Test all possible use-cases of git-status "--ignored" with the
"--untracked-files" option with values "normal" and "all":

 - An untracked directory is listed as untracked if it has a mix of
   untracked and ignored files in it.  With -uall, ignored/untracked
   files are listed as ignored/untracked.

 - An untracked directory with only ignored files is listed as
   ignored.  With -uall, all files in the directory are listed.

 - An ignored directory is listed as ignored. With -uall, all files
   in the directory are listed as ignored.

 - An ignored and committed directory is listed as ignored if it has
   untracked files.  With -uall, all untracked files in the
   directory are listed as ignored.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-send-email: treat field names as case-insensitively

Field names like To:, Cc:, etc. are case-insensitive; use a
case-insensitive regexp to match them as such.

Previously, git-send-email would fail to pick-up the addresses when
in-body "fake" headers with different cases (e.g. lowercase "cc:")
are manually inserted to the messages it was asked to send, even
though the text will still show them.

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
status: always report ignored tracked directories

When enumerating paths that are ignored, paths the index knows
about are not included in the result.  The "index knows about"
check is done by consulting the name hash, not the actual
contents of the index:

 - When core.ignorecase is false, directory names are not in the
   name hash, and ignored ones are shown as ignored (directories
   can never be tracked anyway).

 - When core.ignorecase is true, however, the name hash keeps
   track of the names of directories, in order to detect
   additions of the paths under different cases.  This causes
   ignored directories to be mistakenly excluded when
   enumerating ignored paths.

Stop excluding directories that are in the name hash when
looking for ignored files in dir_add_name(); the names that are
actually in the index are excluded much earlier in the callchain
in treat_file(), so this fix will not make them mistakenly
identified as ignored.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
upload-pack: only accept commits from "shallow" line

We only allow cuts at commits, not arbitrary objects. upload-pack will
fail eventually in register_shallow if a non-commit is given with a
generic error "Object %s is a %s, not a commit". Check it early and
give a more accurate error.

This should never show up in an ordinary session. It's for buggy
clients, or when the user manually edits .git/shallow.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mk/maint-graph-infinity-loop' into maint

* mk/maint-graph-infinity-loop:
  graph.c: infinite loop in git whatchanged --graph -m
Merge branch 'pf/editor-ignore-sigint' into maint

The behaviour visible to the end users was confusing, when they
attempt to kill a process spawned in the editor that was in turn
launched by Git with SIGINT (or SIGQUIT), as Git would catch that
signal and die.  We ignore these signals now.

* pf/editor-ignore-sigint:
  fix compilation with NO_PTHREADS
  launch_editor: propagate signals from editor to git
  run-command: do not warn about child death from terminal
  launch_editor: ignore terminal signals while editor has control
  launch_editor: refactor to use start/finish_command
  run-command: drop silent_exec_failure arg from wait_or_whine
Merge branch 'jc/apply-trailing-blank-removal' into maint

"git apply" misbehaved when fixing whitespace breakages by removing
excess trailing blank lines.

* jc/apply-trailing-blank-removal:
  apply.c:update_pre_post_images(): the preimage can be truncated
Merge branch 'jc/maint-fmt-merge-msg-no-edit-lose-credit' into maint

"git merge --no-edit" computed who were involved in the work done
on the side branch, even though that information is to be discarded
without getting seen in the editor.

* jc/maint-fmt-merge-msg-no-edit-lose-credit:
  merge --no-edit: do not credit people involved in the side branch
Merge branch 'jl/interrupt-clone-remove-separate-git-dir' into maint

When "git clone --separate-git-dir=$over_there" is interrupted, it
failed to remove the real location of the $GIT_DIR it created.  This
was most visible when interrupting a submodule update.

* jl/interrupt-clone-remove-separate-git-dir:
  clone: support atomic operation with --separate-git-dir
Merge branch 'rs/leave-base-name-in-name-field-of-tar' into maint

A tar archive created by "git archive" recorded a directory in a
way that made NetBSD's implementation of "tar" sometimes unhappy.

* rs/leave-base-name-in-name-field-of-tar:
  archive-tar: split long paths more carefully
Merge branch 'jc/comment-cygwin-win32api-in-makefile' into maint

* jc/comment-cygwin-win32api-in-makefile:
  Makefile: add comment on CYGWIN_V15_WIN32API
Merge branch 'jk/maint-fast-import-doc-dedup-done' into maint

* jk/maint-fast-import-doc-dedup-done:
  git-fast-import(1): remove duplicate '--done' option
Merge branch 'jk/shortlog-no-wrap-doc' into maint

* jk/shortlog-no-wrap-doc:
  git-shortlog(1): document behaviour of zero-width wrap
Merge branch 'jk/maint-fast-import-doc-reorder' into maint

* jk/maint-fast-import-doc-reorder:
  git-fast-import(1): reorganise options
  git-fast-import(1): combine documentation of --[no-]relative-marks
Merge branch 'jn/xml-depends-on-asciidoc-conf' into maint

* jn/xml-depends-on-asciidoc-conf:
  docs: manpage XML depends on asciidoc.conf
Merge branch 'jk/unify-exit-code-by-receiving-signal' into maint

* jk/unify-exit-code-by-receiving-signal:
  run-command: encode signal death as a positive integer