mingw_rmdir: do not prompt for retry when non-empty

in ab1a11be ("mingw_rmdir: set errno=ENOTEMPTY when appropriate"),
a check was added to prevent us from retrying to delete a directory
that is both in use and non-empty.

However, this logic was slightly flawed; since we didn't return
immediately, we end up falling out of the retry-loop, but right into
the prompting-loop.

Fix this by setting errno, and guarding the prompting-loop with an
errno-check.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sh-setup: work around "unset IFS" bug in some shells

With an unset IFS, field splitting is supposed to act as if IFS is
set to the usual SP HT LF, but Marc Branchaud reports that the shell
on FreeBSD 7.2 gets this wrong.

It is easy to set it to the default value manually, and it is also
safer in case somebody tries to save the old value away and restore,
e.g.

	$oIFS=$IFS
	IFS=something
	...
	IFS=$oIFS

while forgetting that the original IFS might be unset (which can be
coded but would be more involved).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
shortlog: fix wrapping lines of wraplen

A recent commit [1] fixed a off-by-one wrapping error.  As a
side-effect, the conditional in add_wrapped_shortlog_msg() to decide
whether to append a newline needs to be removed.  The function
should always append a newline, which was the case before the
off-by-one fix, because strbuf_add_wrapped_text() never returns a
value of wraplen; when it returns wraplen, the string does not end
with a newline, so this caller needs to add one anyway.

[1] 14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 utf8: fix off-by-one
    wrapping of text

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf_add_wrapped*(): Remove unused return value

Since shortlog isn't using the return value anymore (see previous
commit), the functions can be changed to void.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-prompt: Document GIT_PS1_DESCRIBE_STYLE

GIT_PS1_DESCRIBE_STYLE was introduced in v1.6.3.2~35.  Document it in the
header comments.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'maint'

* maint:
  git-prompt: Document GIT_PS1_DESCRIBE_STYLE
Merge branch 'ef/mingw-tty-getpass'

Update getpass() emulation for MinGW.

* ef/mingw-tty-getpass:
  mingw: get rid of getpass implementation
  mingw: reuse tty-version of git_terminal_prompt
  compat/terminal: separate input and output handles
  compat/terminal: factor out echo-disabling
  mingw: make fgetc raise SIGINT if apropriate
  mingw: correct exit-code for SIGALRM's SIG_DFL
Merge branch 'ef/mingw-rmdir'

MinGW has a workaround when rmdir unnecessarily fails to retry with
a prompt, but the logic was kicking in when the rmdir failed with
ENOTEMPTY, i.e. was expected to fail and there is no point retrying.

* ef/mingw-rmdir:
  mingw_rmdir: do not prompt for retry when non-empty
Add file completion to tcsh git completion.

For bash completion, the option '-o bashdefault' is used to indicate
that when no other choices are available, file completion should be
performed.  Since this option is not available in tcsh, no file
completion is ever performed.  Therefore, commands like 'git add ',
'git send-email ', etc, require the user to manually type out
the file name.  This can be quite annoying.

To improve the user experience we try to simulate file completion
directly in this script (although not perfectly).

The known issues with the file completion simulation are:
- Possible completions are shown with their directory prefix.
- Completions containing shell variables are not handled.
- Completions with ~ as the first character are not handled.

Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'sp/shortlog-missing-lf' into next

Finishing touches to a new topic merged to 'master'.

* sp/shortlog-missing-lf:
  strbuf_add_wrapped*(): Remove unused return value
  shortlog: fix wrapping lines of wraplen
Merge branch 'jc/maint-fbsd-sh-ifs-workaround' into next

* jc/maint-fbsd-sh-ifs-workaround:
  sh-setup: work around "unset IFS" bug in some shells
Merge branch 'master' into next

* master:
  Add file completion to tcsh git completion.
  git-prompt: Document GIT_PS1_DESCRIBE_STYLE
  mingw_rmdir: do not prompt for retry when non-empty