git.git
11 years agoblame: correctly handle files regardless of autocrlf
brian m. carlson [Sat, 26 Apr 2014 23:10:40 +0000 (23:10 +0000)]
blame: correctly handle files regardless of autocrlf

If a file contained CRLF line endings in a repository with
core.autocrlf=input, then blame always marked lines as "Not
Committed Yet", even if they were unmodified.  Don't attempt to
convert the line endings when creating the fake commit so that blame
works correctly regardless of the autocrlf setting.

Reported-by: Ephrim Khong <redacted>
Signed-off-by: brian m. carlson <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agomv: allow renaming to fix case on case insensitive filesystems
David Turner [Thu, 8 May 2014 17:23:34 +0000 (10:23 -0700)]
mv: allow renaming to fix case on case insensitive filesystems

"git mv hello.txt Hello.txt" on a case insensitive filesystem
always triggers "destination already exists" error, because these
two names refer to the same path from the filesystem's point of
view, and requires the user to give "--force" when correcting the
case of the path recorded in the index and in the next commit.

Detect this case and allow it without requiring "--force".

Signed-off-by: David Turner <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocheckout.c: use ref_exists instead of file_exist
Ronnie Sahlberg [Tue, 6 May 2014 22:45:53 +0000 (15:45 -0700)]
checkout.c: use ref_exists instead of file_exist

Change checkout.c to check if a ref exists instead of checking if a loose ref
file exists when deciding if to delete an orphaned log file. Otherwise, if a
ref only exists as a packed ref without a corresponding loose ref for the
currently checked out branch, we risk that the reflog will be deleted when we
switch to a different branch.

Update the reflog tests to check for this bug.

The following reproduces the bug:
$ git init-db
$ git config core.logallrefupdates true
$ git commit -m Initial --allow-empty
    [master (root-commit) bb11abe] Initial
$ git reflog master
    [8561dcb master@{0}: commit (initial): Initial]
$ find .git/{refs,logs} -type f | grep master
    [.git/refs/heads/master]
    [.git/logs/refs/heads/master]
$ git branch foo
$ git pack-refs --all
$ find .git/{refs,logs} -type f | grep master
    [.git/logs/refs/heads/master]
$ git checkout foo
$ find .git/{refs,logs} -type f | grep master
    ... reflog file is missing ...
$ git reflog master
    ... nothing ...

Signed-off-by: Ronnie Sahlberg <redacted>
Acked-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agorefs.c: add new functions reflog_exists and delete_reflog
Ronnie Sahlberg [Tue, 6 May 2014 22:45:52 +0000 (15:45 -0700)]
refs.c: add new functions reflog_exists and delete_reflog

Add two new functions, reflog_exists and delete_reflog, to hide the internal
reflog implementation (that they are files under .git/logs/...) from callers.
Update checkout.c to use these functions in update_refs_for_switch instead of
building pathnames and calling out to file access functions. Update reflog.c
to use these to check if the reflog exists. Now there are still many places
in reflog.c where we are still leaking the reflog storage implementation but
this at least reduces the number of such dependencies by one. Finally
change two places in refs.c itself to use the new function to check if a ref
exists or not isntead of build-path-and-stat(). Now, this is strictly not all
that important since these are in parts of refs that are implementing the
actual file storage backend but on the other hand it will not hurt either.

Signed-off-by: Ronnie Sahlberg <redacted>
Acked-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoRevert "submodules: fix ambiguous absolute paths under Windows"
Stepan Kasal [Thu, 8 May 2014 20:36:57 +0000 (22:36 +0200)]
Revert "submodules: fix ambiguous absolute paths under Windows"

This reverts commit 4dce7d9b408b2935b85721b54a2010eda7ec1be9,
which was originally done to help Windows but was almost
immediately reverted in msysGit, and the codebase kept this
unnecessary divergence for almost two years.

Signed-off-by: Stepan Kasal <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoSync with maint
Junio C Hamano [Thu, 8 May 2014 18:59:51 +0000 (11:59 -0700)]
Sync with maint

* maint:
  shell doc: remove stray "+" in example
  Start preparing for 1.9.3

11 years agoshell doc: remove stray "+" in example
Jonathan Nieder [Wed, 7 May 2014 23:44:01 +0000 (16:44 -0700)]
shell doc: remove stray "+" in example

The git-shell(1) manpage says

EXAMPLE
       To disable interactive logins, displaying a greeting
instead:

+

   $ chsh -s /usr/bin/git-shell
   $ mkdir $HOME/git-shell-commands
[...]

The stray "+" has been there ever since the example was added in
v1.8.3-rc0~210^2 (shell: new no-interactive-login command to print a
custom message, 2013-03-09).  The "+" sign between paragraphs is
needed in asciidoc to attach extra paragraphs to a list item but here
it is not needed and ends up rendered as a literal "+".  Remove it.

A quick search with "grep -e '<p>+' /usr/share/doc/git/html/*.html"
doesn't find any other instances of this problem.

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoMerge git://github.com/git-l10n/git-po
Junio C Hamano [Thu, 8 May 2014 17:25:37 +0000 (10:25 -0700)]
Merge git://github.com/git-l10n/git-po

* 'master' of git://github.com/git-l10n/git-po:
  l10n: Fix a couple of typos in the Swedish translation

11 years agoStart preparing for 1.9.3
Junio C Hamano [Thu, 8 May 2014 17:05:22 +0000 (10:05 -0700)]
Start preparing for 1.9.3

Signed-off-by: Junio C Hamano <redacted>
11 years agoMerge branch 'cl/p4-use-diff-tree' into maint
Junio C Hamano [Thu, 8 May 2014 17:01:32 +0000 (10:01 -0700)]
Merge branch 'cl/p4-use-diff-tree' into maint

"git p4" dealing with changes in binary files were broken by a
change in 1.9 release.

* cl/p4-use-diff-tree:
  git-p4: format-patch to diff-tree change breaks binary patches

11 years agoMerge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint
Junio C Hamano [Thu, 8 May 2014 17:01:18 +0000 (10:01 -0700)]
Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint

The shell prompt script (in contrib/), when using the PROMPT_COMMAND
interface, used an unsafe construct when showing the branch name in
$PS1.

* rh/prompt-pcmode-avoid-eval-on-refname:
  git-prompt.sh: don't put unsanitized branch names in $PS1

11 years agoMerge branch 'km/avoid-non-function-return-in-rebase' into maint
Junio C Hamano [Thu, 8 May 2014 17:01:06 +0000 (10:01 -0700)]
Merge branch 'km/avoid-non-function-return-in-rebase' into maint

"git rebase" used a POSIX shell construct FreeBSD /bin/sh does not
work well with.

* km/avoid-non-function-return-in-rebase:
  Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
  rebase: avoid non-function use of "return" on FreeBSD

11 years agoMerge branch 'tb/unicode-6.3-zero-width' into maint
Junio C Hamano [Thu, 8 May 2014 17:00:45 +0000 (10:00 -0700)]
Merge branch 'tb/unicode-6.3-zero-width' into maint

Some more Unicode codepoints defined in Unicode 6.3 as having zero
width have been taught to our display column counting logic.

* tb/unicode-6.3-zero-width:
  utf8.c: partially update to version 6.3

11 years agoMerge branch 'km/avoid-bs-in-shell-glob' into maint
Junio C Hamano [Thu, 8 May 2014 17:00:36 +0000 (10:00 -0700)]
Merge branch 'km/avoid-bs-in-shell-glob' into maint

Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-bs-in-shell-glob:
  test: fix t5560 on FreeBSD

11 years agoMerge branch 'km/avoid-cp-a' into maint
Junio C Hamano [Thu, 8 May 2014 16:59:41 +0000 (09:59 -0700)]
Merge branch 'km/avoid-cp-a' into maint

Some tests used shell constructs that did not work well on FreeBSD

* km/avoid-cp-a:
  test: fix t7001 cp to use POSIX options

11 years agoUpdate draft release notes for 2.0
Junio C Hamano [Wed, 7 May 2014 22:50:15 +0000 (15:50 -0700)]
Update draft release notes for 2.0

Describe one last minute one-liner fix for regression introduced in
1.9, and fix a grave mischaracterization on a recent remote-hg/bzr
change, pointed out by Felipe.

Signed-off-by: Junio C Hamano <redacted>
11 years agoMerge branch 'cl/p4-use-diff-tree'
Junio C Hamano [Wed, 7 May 2014 21:39:29 +0000 (14:39 -0700)]
Merge branch 'cl/p4-use-diff-tree'

Fixes a regression in 1.9.0 with an obviously correct single-liner.

* cl/p4-use-diff-tree:
  git-p4: format-patch to diff-tree change breaks binary patches

11 years agobuiltin/tag.c: show tag name to hint in the message editor
Thorsten Glaser [Thu, 29 Aug 2013 22:03:10 +0000 (00:03 +0200)]
builtin/tag.c: show tag name to hint in the message editor

Display the tag name about to be added to the user during interactive
editing.

Signed-off-by: Thorsten Glaser <redacted>
Signed-off-by: Richard Hartmann <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agomerge-recursive.c: fix case-changing merge bug
David Turner [Fri, 2 May 2014 00:21:09 +0000 (20:21 -0400)]
merge-recursive.c: fix case-changing merge bug

On a case-insensitive filesystem, when merging, a file would be
wrongly deleted from the working tree if an incoming commit had
renamed it changing only its case.  When merging a rename, the file
with the old name would be deleted -- but since the filesystem
considers the old name to be the same as the new name, the new
file would in fact be deleted.

We avoid this by not deleting files that have a case-clone in the
index at stage 0.

Signed-off-by: David Turner <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agopager: remove 'S' from $LESS by default
Matthieu Moy [Wed, 30 Apr 2014 07:35:25 +0000 (09:35 +0200)]
pager: remove 'S' from $LESS by default

By default, Git used to set $LESS to -FRSX if $LESS was not set by
the user. The FRX flags actually make sense for Git (F and X because
sometimes the output Git pipes to less is short, and R because Git
pipes colored output). The S flag (chop long lines), on the other
hand, is not related to Git and is a matter of user preference. Git
should not decide for the user to change LESS's default.

More specifically, the S flag harms users who review untrusted code
within a pager, since a patch looking like:

    -old code;
    +new good code; [... lots of tabs ...] malicious code;

would appear identical to:

    -old code;
    +new good code;

Users who prefer the old behavior can still set the $LESS environment
variable to -FRSX explicitly, or set core.pager to 'less -S'.

The documentation in config.txt is made a bit longer to keep both an
example setting the 'S' flag (needed to recover the old behavior)
and an example showing how to unset a flag set by Git.

Signed-off-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agosilence a bunch of format-zero-length warnings
Felipe Contreras [Sun, 4 May 2014 06:12:55 +0000 (01:12 -0500)]
silence a bunch of format-zero-length warnings

This can be observed in many versions of gcc and still exists with 4.9.0:

  wt-status.c: In function ‘wt_status_print_unmerged_header’:
  wt-status.c:191:2: warning: zero-length gnu_printf format string [-Wformat-zero-length]
    status_printf_ln(s, c, "");
    ^

The user have long been told to pass -Wno-format-zero-length, but a
patch that avoids warning altogether is not too noisy, so let's do
so.

Signed-off-by: Felipe Contreras <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agogrep: use run-command's "dir" option for --open-files-in-pager
Jeff King [Wed, 7 May 2014 03:00:37 +0000 (23:00 -0400)]
grep: use run-command's "dir" option for --open-files-in-pager

Git generally changes directory to the repository root on
startup.  When running "grep --open-files-in-pager" from a
subdirectory, we chdir back to the original directory before
running the pager, so that we can feed the relative
pathnames to the pager.

We currently do this chdir manually, but we can ask
run_command to do it for us. This is fewer lines of code,
and as a bonus, the chdir is limited to the child process,
which avoids any unexpected surprises for code running after
the pager (there isn't any currently, but this is
future-proofing).

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agogit-p4: format-patch to diff-tree change breaks binary patches
Tolga Ceylan [Wed, 7 May 2014 05:48:54 +0000 (22:48 -0700)]
git-p4: format-patch to diff-tree change breaks binary patches

When applying binary patches a full index is required. format-patch
already handles this, but diff-tree needs '--full-index' argument
to always output full index. When git-p4 runs git-apply to test
the patch, git-apply rejects the patch due to abbreviated blob
object names. This is the error message git-apply emits in this
case:

    error: cannot apply binary patch to '<filename>' without full index line
    error: <filename>: patch does not apply

Signed-off-by: Tolga Ceylan <redacted>
Acked-by: Pete Wyckoff <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agol10n: Fix a couple of typos in the Swedish translation
Peter Krefting [Wed, 7 May 2014 06:06:37 +0000 (07:06 +0100)]
l10n: Fix a couple of typos in the Swedish translation

Thanks-to: Anders Jonsson <redacted>
Signed-off-by: Peter Krefting <redacted>
11 years agoRelNotes/2.0.0: Grammar and typo fixes
Øyvind A. Holm [Sat, 3 May 2014 19:08:50 +0000 (21:08 +0200)]
RelNotes/2.0.0: Grammar and typo fixes

Signed-off-by: Øyvind A. Holm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocontrib/subtree/Makefile: clean up rule for "clean"
James Denholm [Tue, 6 May 2014 12:41:49 +0000 (22:41 +1000)]
contrib/subtree/Makefile: clean up rule for "clean"

git:Documentation/Makefile and others establish "RM ?= rm -f" as a
convention for rm calls in clean rules, hence follow this convention
instead of simply forcing clean to use rm.

subproj and mainline no longer need to be removed in clean, as they are
no longer created in git:contrib/subtree by "make test". Hence, remove
the rm call for those folders.

Other makefiles don't remove "*~" files, remove the rm call to prevent
unexpected behaviour in the future. Similarly, clean doesn't remove the
installable file, so rectify this.

Reviewed-by: Jeff King <redacted>
Signed-off-by: James Denholm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocontrib/subtree/Makefile: clean up rules to generate documentation
James Denholm [Tue, 6 May 2014 12:41:48 +0000 (22:41 +1000)]
contrib/subtree/Makefile: clean up rules to generate documentation

git:Documentation/Makefile establishes asciidoc/xmlto calls as being
handled through their appropriate variables, Hence, change to bring into
congruency with.

Similarly, MANPAGE_XSL exists in git:Documentation/Makefile, while
MANPAGE_NORMAL_XSL does not outside contrib/subtree. Hence, replace
MANPAGE_NORMAL_XSL with MANPAGE_XSL.

Reviewed-by: Jeff King <redacted>
Signed-off-by: James Denholm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocontrib/subtree/Makefile: s/libexecdir/gitexecdir/
James Denholm [Tue, 6 May 2014 12:41:47 +0000 (22:41 +1000)]
contrib/subtree/Makefile: s/libexecdir/gitexecdir/

$(libexecdir) isn't used anywhere else in the project, while
$(gitexecdir) is the standard in the other appropriate makefiles. Hence,
replace the former with the latter.

Reviewed-by: Jeff King <redacted>
Signed-off-by: James Denholm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocontrib/subtree/Makefile: use GIT-VERSION-FILE
James Denholm [Tue, 6 May 2014 12:41:46 +0000 (22:41 +1000)]
contrib/subtree/Makefile: use GIT-VERSION-FILE

GVF is already being used in most/all other makefiles in the project,
and has been for _quite_ a while. Hence, drop file-unique gitver and
replace with GIT_VERSION.

Reviewed-by: Jeff King <redacted>
Signed-off-by: James Denholm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoapi-strbuf.txt: add docs for _trim and _ltrim
Brian Gesiak [Wed, 30 Apr 2014 08:58:07 +0000 (17:58 +0900)]
api-strbuf.txt: add docs for _trim and _ltrim

API documentation for strbuf does not document strbuf_trim() or
strbuf_ltrim(). Add documentation for these two functions.

Signed-off-by: Brian Gesiak <redacted>
Reviewed-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agostrbuf: use _rtrim and _ltrim in strbuf_trim
Brian Gesiak [Wed, 30 Apr 2014 08:58:06 +0000 (17:58 +0900)]
strbuf: use _rtrim and _ltrim in strbuf_trim

strbuf_trim() strips whitespace from the end, then the beginning of
a strbuf.  Those operations are duplicated in strbuf_rtrim() and
strbuf_ltrim().

Replace strbuf_trim() implementation with calls to strbuf_rtrim(),
then strbuf_ltrim().

Signed-off-by: Brian Gesiak <redacted>
Reviewed-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoBump core.deltaBaseCacheLimit to 96m
David Kastrup [Sun, 4 May 2014 17:13:57 +0000 (19:13 +0200)]
Bump core.deltaBaseCacheLimit to 96m

The default of 16m causes serious thrashing for large delta chains
combined with large files.

Here are some benchmarks (pu variant of git blame):

time git blame -C src/xdisp.c >/dev/null

for a repository of Emacs repacked with git gc --aggressive (v1.9,
resulting in a window size of 250) located on an SSD drive.  The file in
question has about 30000 lines, 1Mb of size, and a history with about
2500 commits.

    16m (previous default):
    real 3m33.936s
    user 2m15.396s
    sys 1m17.352s

    32m:
    real 3m1.319s
    user 2m8.660s
    sys 0m51.904s

    64m:
    real 2m20.636s
    user 1m55.780s
    sys 0m23.964s

    96m:
    real 2m5.668s
    user 1m50.784s
    sys 0m14.288s

    128m:
    real 2m4.337s
    user 1m50.764s
    sys 0m12.832s

    192m:
    real 2m3.567s
    user 1m49.508s
    sys 0m13.312s

Signed-off-by: David Kastrup <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agolet clang use the constant-return error() macro
Jeff King [Tue, 6 May 2014 15:17:50 +0000 (11:17 -0400)]
let clang use the constant-return error() macro

Commit e208f9c converted error() into a macro to make its
constant return value more apparent to calling code.  Commit
5ded807 prevents us using this macro with clang, since
clang's -Wunused-value is smart enough to realize that the
constant "-1" is useless in some contexts.

However, since the last commit puts the constant behind an
inline function call, this is enough to prevent the
-Wunused-value warning on both modern gcc and clang. So we
can now re-enable the macro when compiling with clang.

Tested with clang 3.3, 3.4, and 3.5.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoinline constant return from error() function
Jeff King [Tue, 6 May 2014 15:14:42 +0000 (11:14 -0400)]
inline constant return from error() function

Commit e208f9c introduced a macro to turn error() calls
into:

  (error(), -1)

to make the constant return value more visible to the
calling code (and thus let the compiler make better
decisions about the code).

This works well for code like:

  return error(...);

but the "-1" is superfluous in code that just calls error()
without caring about the return value. In older versions of
gcc, that was fine, but gcc 4.9 complains with -Wunused-value.

We can work around this by encapsulating the constant return
value in a static inline function, as gcc specifically
avoids complaining about unused function returns unless the
function has been specifically marked with the
warn_unused_result attribute.

We also use the same trick for config_error_nonbool and
opterror, which learned the same error technique in a469a10.

Reported-by: Felipe Contreras <redacted>
Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoconfig: preserve config file permissions on edits
Eric Wong [Tue, 6 May 2014 00:17:14 +0000 (00:17 +0000)]
config: preserve config file permissions on edits

Users may already store sensitive data such as imap.pass in
.git/config; making the file world-readable when "git config"
is called to edit means their password would be compromised
on a shared system.

[v2: updated for section renames, as noted by Junio]

Signed-off-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocontrib/subtree/Makefile: scrap unused $(gitdir)
James Denholm [Tue, 6 May 2014 12:41:45 +0000 (22:41 +1000)]
contrib/subtree/Makefile: scrap unused $(gitdir)

In 7ff8463dba0d74fc07a766bed457ae7afcc902b5, the references to gitdir
were removed but the assignment itself wasn't. Hence, drop the gitdir
assignment.

Reviewed-by: Jeff King <redacted>
Signed-off-by: James Denholm <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoMSVC: link dynamically to the CRT
Karsten Blees [Fri, 7 Jan 2011 16:20:21 +0000 (17:20 +0100)]
MSVC: link dynamically to the CRT

Dynamic linking is generally preferred over static linking, and MSVCRT.dll
has been integral part of Windows for a long time.

This also fixes linker warnings for _malloc and _free in zlib.lib, which
seems to be compiled for MSVCRT.dll already.

The DLL version also exports some of the CRT initialization functions,
which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by
subsequent Unicode patches).

Signed-off-by: Karsten Blees <redacted>
Signed-off-by: Stepan Kasal <redacted>
Acked-by: Sebastian Schuberth <redacted>
Acked-by: Marat Radchenko <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocommit: accept more date formats for "--date"
Jeff King [Fri, 2 May 2014 01:12:42 +0000 (21:12 -0400)]
commit: accept more date formats for "--date"

Right now we pass off the string found by "--date" straight
to the fmt_ident function, which will use our strict
parse_date to normalize it. However, this means obvious
things like "--date=now" or "--date=2.days.ago" will not
work.

Instead, let's fallback to the approxidate function to
handle this for us. Note that we must try parse_date
ourselves first, even though approxidate will try strict
parsing itself. The reason is that approxidate throws away
any timezone information it sees from the strict parsing,
and we want to preserve it. So asking for:

  git commit --date="@1234567890 -0700"

continues to set the date in -0700, regardless of what the
local timezone is.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocommit: print "Date" line when the user has set date
Jeff King [Fri, 2 May 2014 01:10:01 +0000 (21:10 -0400)]
commit: print "Date" line when the user has set date

When we make a commit and the author is not the same as the
committer (e.g., because you used "-c $commit" or
"--author=$somebody"), we print the author's name and email
in both the commit-message template and as part of the
commit summary. This is a safety check to give the user a
chance to confirm that we are doing what they expect.

This patch brings the same safety for the "date" field,
which may be set by "-c" or by using "--date".  Note that we
explicitly do not set it for $GIT_AUTHOR_DATE, as it is
probably not of interest when "git commit" is being fed its
parameters by a script.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agopretty: make show_ident_date public
Jeff King [Fri, 2 May 2014 01:07:22 +0000 (21:07 -0400)]
pretty: make show_ident_date public

We use this function internally to format "Date" lines in
commit logs, but other parts of the code will want it, too.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocommit: use split_ident_line to compare author/committer
Jeff King [Fri, 2 May 2014 01:06:57 +0000 (21:06 -0400)]
commit: use split_ident_line to compare author/committer

Instead of string-wise comparing the author/committer lines
with their timestamps truncated, we can use split_ident_line
and ident_cmp. These functions are more robust than our
ad-hoc parsing, though in practice it should not matter, as
we just generated these ident lines ourselves.

However, this will also allow us easy access to the
timestamp and tz fields in future patches.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: on splitting a long line
Junio C Hamano [Fri, 2 May 2014 20:42:39 +0000 (13:42 -0700)]
CodingGuidelines: on splitting a long line

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: on comparison
Junio C Hamano [Wed, 30 Apr 2014 21:26:23 +0000 (14:26 -0700)]
CodingGuidelines: on comparison

There are arguments for writing a conditional as "a < b" rather than
"b > a", or vice versa.  Let's give guidance on which we prefer.

See http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
for the original discussion.

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: do not call the conditional statement "if()"
Junio C Hamano [Wed, 30 Apr 2014 21:25:47 +0000 (14:25 -0700)]
CodingGuidelines: do not call the conditional statement "if()"

The point immediately before it is about having SP after the control
keyword.  Spell it out as 'an "if" statement' instead.

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: give an example for shell function preamble
Junio C Hamano [Wed, 30 Apr 2014 21:25:11 +0000 (14:25 -0700)]
CodingGuidelines: give an example for shell function preamble

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: give an example for control statements
Junio C Hamano [Wed, 30 Apr 2014 21:24:52 +0000 (14:24 -0700)]
CodingGuidelines: give an example for control statements

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: give an example for redirection
Junio C Hamano [Wed, 30 Apr 2014 21:24:24 +0000 (14:24 -0700)]
CodingGuidelines: give an example for redirection

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: give an example for case/esac statement
Junio C Hamano [Wed, 30 Apr 2014 21:24:08 +0000 (14:24 -0700)]
CodingGuidelines: give an example for case/esac statement

Signed-off-by: Junio C Hamano <redacted>
11 years agoCodingGuidelines: once it is in, it is not worth the code churn
Junio C Hamano [Wed, 30 Apr 2014 21:23:26 +0000 (14:23 -0700)]
CodingGuidelines: once it is in, it is not worth the code churn

Signed-off-by: Junio C Hamano <redacted>
11 years agoGit 2.0-rc2
Junio C Hamano [Fri, 2 May 2014 20:15:52 +0000 (13:15 -0700)]
Git 2.0-rc2

11 years agoMerge branch 'mw/symlinks'
Junio C Hamano [Fri, 2 May 2014 20:11:02 +0000 (13:11 -0700)]
Merge branch 'mw/symlinks'

A finishing touch fix to a new change already in 'master'.

* mw/symlinks:
  setup: fix windows path buffer over-stepping

11 years agoMerge branch 'km/git-svn-workaround-older-getopt-long'
Junio C Hamano [Fri, 2 May 2014 20:10:58 +0000 (13:10 -0700)]
Merge branch 'km/git-svn-workaround-older-getopt-long'

* km/git-svn-workaround-older-getopt-long:
  t9117: use --prefix "" instead of --prefix=""

11 years agoMerge branch 'rh/prompt-pcmode-avoid-eval-on-refname'
Junio C Hamano [Fri, 2 May 2014 20:10:53 +0000 (13:10 -0700)]
Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname'

* rh/prompt-pcmode-avoid-eval-on-refname:
  git-prompt.sh: don't put unsanitized branch names in $PS1

11 years agoMerge branch 'mk/doc-git-gui-display-untracked'
Junio C Hamano [Fri, 2 May 2014 20:10:47 +0000 (13:10 -0700)]
Merge branch 'mk/doc-git-gui-display-untracked'

* mk/doc-git-gui-display-untracked:
  Documentation: git-gui: describe gui.displayuntracked

11 years agocompat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
Junio C Hamano [Fri, 2 May 2014 19:36:10 +0000 (12:36 -0700)]
compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN

The previous commit swaps the order we check the macros defined by
the compiler and the system headers from the original.  Since the
order of check should not matter (i.e. it is insane to define both
__BIG_ENDIAN and friends and BIG_ENDIAN and friends and in a
conflicting way), it is the most conservative thing to do not to
change it.

Signed-off-by: Junio C Hamano <redacted>
11 years agocompat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER
Charles Bailey [Fri, 2 May 2014 07:55:29 +0000 (08:55 +0100)]
compat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER

Signed-off-by: Charles Bailey <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agodocs: document RUN_SETUP_GENTLY and clarify RUN_SETUP
David Turner [Tue, 29 Apr 2014 19:21:34 +0000 (15:21 -0400)]
docs: document RUN_SETUP_GENTLY and clarify RUN_SETUP

We only said what happens when we find the Git directory under
RUN_SETUP, without saying what happens otherwise.

Signed-off-by: David Turner <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot5000-tar-tree.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:07 +0000 (09:23 -0700)]
t5000-tar-tree.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4204-patch-id.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:06 +0000 (09:23 -0700)]
t4204-patch-id.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4119-apply-config.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:05 +0000 (09:23 -0700)]
t4119-apply-config.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4116-apply-reverse.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:04 +0000 (09:23 -0700)]
t4116-apply-reverse.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4057-diff-combined-paths.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:03 +0000 (09:23 -0700)]
t4057-diff-combined-paths.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4038-diff-combined.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:02 +0000 (09:23 -0700)]
t4038-diff-combined.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4036-format-patch-signer-mime.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:01 +0000 (09:23 -0700)]
t4036-format-patch-signer-mime.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4014-format-patch.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:23:00 +0000 (09:23 -0700)]
t4014-format-patch.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4013-diff-various.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:59 +0000 (09:22 -0700)]
t4013-diff-various.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4012-diff-binary.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:58 +0000 (09:22 -0700)]
t4012-diff-binary.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4010-diff-pathspec.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:57 +0000 (09:22 -0700)]
t4010-diff-pathspec.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot4006-diff-mode.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:56 +0000 (09:22 -0700)]
t4006-diff-mode.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot3910-mac-os-precompose.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:55 +0000 (09:22 -0700)]
t3910-mac-os-precompose.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot3905-stash-include-untracked.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 30 Apr 2014 16:22:54 +0000 (09:22 -0700)]
t3905-stash-include-untracked.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoMerge git://github.com/git-l10n/git-po
Junio C Hamano [Wed, 30 Apr 2014 18:01:42 +0000 (11:01 -0700)]
Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
  l10n: de.po: improve hint for autocorrected command execution
  l10n: de.po: translate 45 new messages
  l10n: de.po: correct translation of "completed" after resolving deltas
  l10n: zh_CN.po: translate 46 new messages (2229t0f0u)
  l10n: fr translation for v2.0.0rc0 (2228t)
  l10n: Update Swedish translation (2228t0f0u)
  l10n: vi.po (2228t): Update and minor fix
  l10n: git.pot: v2.0.0 round 1 (45 new, 28 removed)

11 years agoRevert the whole "ask curl-config" topic for now
Junio C Hamano [Wed, 30 Apr 2014 17:58:10 +0000 (10:58 -0700)]
Revert the whole "ask curl-config" topic for now

Postpone this a bit during the feature freeze and retry the effort
in the next cycle.

11 years agorerere: fix for merge.conflictstyle
Felipe Contreras [Wed, 30 Apr 2014 04:08:29 +0000 (23:08 -0500)]
rerere: fix for merge.conflictstyle

If we use a different conflict style `git rerere forget` is not able
to find the matching conflict SHA-1 because the diff generated is
actually different from what `git merge` generated, due to the
XDL_MERGE_* option differences among the codepaths.

The fix is to call git_xmerge_config() so that git_xmerge_style is set
properly and the diffs match.

Signed-off-by: Felipe Contreras <redacted>
Reviewed-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1050-large.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:37 +0000 (05:57 -0700)]
t1050-large.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1020-subdirectory.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:36 +0000 (05:57 -0700)]
t1020-subdirectory.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:35 +0000 (05:57 -0700)]
t1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:34 +0000 (05:57 -0700)]
t1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:33 +0000 (05:57 -0700)]
t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:32 +0000 (05:57 -0700)]
t1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot1000-read-tree-m-3way.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:31 +0000 (05:57 -0700)]
t1000-read-tree-m-3way.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0300-credentials.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:30 +0000 (05:57 -0700)]
t0300-credentials.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0030-stripspace.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:29 +0000 (05:57 -0700)]
t0030-stripspace.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0026-eol-config.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:28 +0000 (05:57 -0700)]
t0026-eol-config.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0025-crlf-auto.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:27 +0000 (05:57 -0700)]
t0025-crlf-auto.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0020-crlf.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:26 +0000 (05:57 -0700)]
t0020-crlf.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0010-racy-git.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:25 +0000 (05:57 -0700)]
t0010-racy-git.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot0001-init.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 28 Apr 2014 12:57:24 +0000 (05:57 -0700)]
t0001-init.sh: use the $( ... ) construct for command substitution

The Git CodingGuidelines prefer the $(...) construct for command
substitution instead of using the backquotes `...`.

The backquoted form is the traditional method for command
substitution, and is supported by POSIX.  However, all but the
simplest uses become complicated quickly.  In particular, embedded
command substitutions and/or the use of double quotes require
careful escaping with the backslash character.

The patch was generated by:

for _f in $(find . -name "*.sh")
do
   sed -i 's@`\(.*\)`@$(\1)@g' ${_f}
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Reviewed-by: Matthieu Moy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agosequencer: do not update/refresh index if the lock cannot be held
Nguyễn Thái Ngọc Duy [Mon, 28 Apr 2014 10:55:24 +0000 (17:55 +0700)]
sequencer: do not update/refresh index if the lock cannot be held

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoewah: delete unused ewah_read_mmap_native declaration
Nguyễn Thái Ngọc Duy [Mon, 28 Apr 2014 10:55:23 +0000 (17:55 +0700)]
ewah: delete unused ewah_read_mmap_native declaration

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoewah: fix constness of ewah_read_mmap
Nguyễn Thái Ngọc Duy [Mon, 28 Apr 2014 10:55:22 +0000 (17:55 +0700)]
ewah: fix constness of ewah_read_mmap

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoreplace: add --edit option
Jeff King [Sat, 26 Apr 2014 20:00:57 +0000 (22:00 +0200)]
replace: add --edit option

This allows you to run:

    git replace --edit SHA1

to get dumped in an editor with the contents of the object
for SHA1. The result is then read back in and used as a
"replace" object for SHA1. The writing/reading is
type-aware, so you get to edit "ls-tree" output rather than
the binary tree format.

Missing documentation and tests.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoreplace: factor object resolution out of replace_object
Jeff King [Sat, 26 Apr 2014 20:00:56 +0000 (22:00 +0200)]
replace: factor object resolution out of replace_object

As we add new options that operate on objects before
replacing them, we'll want to be able to feed raw sha1s
straight into replace_object. Split replace_object into the
object-resolution part and the actual replacement.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoreplace: use OPT_CMDMODE to handle modes
Jeff King [Sat, 26 Apr 2014 20:00:55 +0000 (22:00 +0200)]
replace: use OPT_CMDMODE to handle modes

By using OPT_CMDMODE, the mutual exclusion between modes is
taken care of for us. It also makes it easy for us to
maintain a single variable with the mode, which makes its
intent more clear. We can use a single switch() to make sure
we have covered all of the modes.

This ends up breaking even in code size, but the win will be
much bigger when we start adding more modes.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoreplace: refactor command-mode determination
Jeff King [Sat, 26 Apr 2014 20:00:54 +0000 (22:00 +0200)]
replace: refactor command-mode determination

The git-replace command has three modes: listing, deleting,
and replacing. The first two are selected explicitly. If
none is selected, we fallback to listing when there are no
arguments, and replacing otherwise.

Let's figure out up front which operation we are going to
do, before getting into the application logic. That lets us
simplify our option checks (e.g., we currently have to check
whether a useless "--force" is given both along with an
explicit list, as well as with an implicit one).

This saves some lines, makes the logic easier to follow, and
will facilitate further cleanups.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agotest/send-email: to-cover, cc-cover tests
Michael S. Tsirkin [Tue, 29 Apr 2014 05:41:18 +0000 (08:41 +0300)]
test/send-email: to-cover, cc-cover tests

Add tests for the new feature.

Signed-off-by: Michael S. Tsirkin <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agogit-send-email: two new options: to-cover, cc-cover
Michael S. Tsirkin [Tue, 29 Apr 2014 05:41:16 +0000 (08:41 +0300)]
git-send-email: two new options: to-cover, cc-cover

Allow extracting To/Cc addresses from the first patch
(typically the cover letter), and use them as To/Cc addresses of the
remainder of the series.

Signed-off-by: Michael S. Tsirkin <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agoimap-send: use git-credential
Dan Albert [Tue, 29 Apr 2014 03:00:04 +0000 (20:00 -0700)]
imap-send: use git-credential

git-imap-send was directly prompting for a password rather than using
git-credential. git-send-email, on the other hand, supports git-credential.

This is a necessary improvement for users that use two factor authentication, as
they should not be expected to remember all of their app specific passwords.

Signed-off-by: Dan Albert <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agot3910: show failure of core.precomposeunicode with decomposed filenames
Jeff King [Mon, 28 Apr 2014 16:16:31 +0000 (12:16 -0400)]
t3910: show failure of core.precomposeunicode with decomposed filenames

If you have existing decomposed filenames in your git
repository (e.g., that were created with older versions of
git that did not precompose unicode), a modern git with
core.precomposeunicode set does not handle them well.

The problem is that we normalize the paths coming from the
disk into their precomposed form, and then compare them
against the literal bytes in the index. This makes things
better if you have the precomposed form in the index. It
makes things worse if you actually have the decomposed form
in the index.

As a result, paths with decomposed filenames may have their
precomposed variants listed as untracked files (even though
the precomposed variants do not exist on-disk at all).

This patch just adds a test to demonstrate the breakage.
Some possible fixes are:

  1. Tell everyone that NFD in the git repo is wrong, and
     they should make a new commit to normalize all their
     in-repo files to be precomposed.

     This is probably not the right thing to do, because it
     still doesn't fix checkouts of old history. And it
     spreads the problem to people on byte-preserving
     filesystems (like ext4), because now they have to start
     precomposing their filenames as they are adde to git.

  2. Do all index filename comparisons using a UTF-8 aware
     comparison function when core.precomposeunicode is set.
     This would probably have bad performance, and somewhat
     defeats the point of converting the filenames at the
     readdir level in the first place.

  3. Convert index filenames to their precomposed form when
     we read the index from disk. This would be efficient,
     but we would have to be careful not to write the
     precomposed forms back out to disk.

  4. Introduce some infrastructure to efficiently match up
     the precomposed/decomposed forms. We already do
     something similar for case-insensitive files using
     name-hash.c. We might be able to adapt that strategy
     here.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
11 years agocompat/poll: sleep 1 millisecond to avoid busy wait
Theodore Leblond [Wed, 16 May 2012 13:52:49 +0000 (06:52 -0700)]
compat/poll: sleep 1 millisecond to avoid busy wait

SwitchToThread() only gives away the rest of the current time slice
to another thread in the current process. So if the thread that feeds
the file decscriptor we're polling is not in the current process, we
get busy-waiting.

I played around with this quite a bit. After trying some more complex
schemes, I found that what worked best is to just sleep 1 millisecond
between iterations. Though it's a very short time, it still completely
eliminates the busy wait condition, without hurting perf.

There code uses SleepEx(1, TRUE) to sleep. See this page for a good
discussion of why that is better than calling SwitchToThread, which
is what was used previously:
http://stackoverflow.com/questions/1383943/switchtothread-vs-sleep1

Note that calling SleepEx(0, TRUE) does *not* solve the busy wait.

The most striking case was when testing on a UNC share with a large repo,
on a single CPU machine. Without the fix, it took 4 minutes 15 seconds,
and with the fix it took just 1:08! I think it's because git-upload-pack's
busy wait was eating the CPU away from the git process that's doing the
real work. With multi-proc, the timing is not much different, but tons of
CPU time is still wasted, which can be a killer on a server that needs to
do bunch of other things.

I also tested the very fast local case, and didn't see any measurable
difference. On a big repo with 4500 files, the upload-pack took about 2
seconds with and without the fix.

[jc: this was first accepted in msysgit tree in May 2012 via a pull
request and Paolo Bonzini has also accepted the same fix to Gnulib
around the same time; see $gmane/247518 for a bit more detail]

Signed-off-by: Stepan Kasal <redacted>
Acked-by: Johannes Sixt <redacted>
Acked-by: Erik Faye-Lund <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT