git.git
10 years agot9150-svk-mergetickets.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:34 +0000 (11:49 +0000)]
t9150-svk-mergetickets.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9145-git-svn-master-branch.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:33 +0000 (11:49 +0000)]
t9145-git-svn-master-branch.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9138-git-svn-authors-prog.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:32 +0000 (11:49 +0000)]
t9138-git-svn-authors-prog.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9137-git-svn-dcommit-clobber-series.sh: use the $( ... ) construct for command subst...
Elia Pinto [Tue, 12 Jan 2016 11:49:31 +0000 (11:49 +0000)]
t9137-git-svn-dcommit-clobber-series.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9132-git-svn-broken-symlink.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:30 +0000 (11:49 +0000)]
t9132-git-svn-broken-symlink.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9130-git-svn-authors-file.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:29 +0000 (11:49 +0000)]
t9130-git-svn-authors-file.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9129-git-svn-i18n-commitencoding.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:28 +0000 (11:49 +0000)]
t9129-git-svn-i18n-commitencoding.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9119-git-svn-info.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 11:49:27 +0000 (11:49 +0000)]
t9119-git-svn-info.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9118-git-svn-funky-branch-names.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:18 +0000 (10:45 +0000)]
t9118-git-svn-funky-branch-names.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9114-git-svn-dcommit-merge.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:17 +0000 (10:45 +0000)]
t9114-git-svn-dcommit-merge.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9110-git-svn-use-svm-props.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:16 +0000 (10:45 +0000)]
t9110-git-svn-use-svm-props.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9109-git-svn-multi-glob.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:15 +0000 (10:45 +0000)]
t9109-git-svn-multi-glob.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9108-git-svn-glob.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:14 +0000 (10:45 +0000)]
t9108-git-svn-glob.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9107-git-svn-migrate.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:13 +0000 (10:45 +0000)]
t9107-git-svn-migrate.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9105-git-svn-commit-diff.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:12 +0000 (10:45 +0000)]
t9105-git-svn-commit-diff.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9104-git-svn-follow-parent.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:11 +0000 (10:45 +0000)]
t9104-git-svn-follow-parent.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9101-git-svn-props.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:10 +0000 (10:45 +0000)]
t9101-git-svn-props.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot9100-git-svn-basic.sh: use the $( ... ) construct for command substitution
Elia Pinto [Tue, 12 Jan 2016 10:45:09 +0000 (10:45 +0000)]
t9100-git-svn-basic.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocheckout,clone: check return value of create_symref
Jeff King [Tue, 12 Jan 2016 09:57:34 +0000 (04:57 -0500)]
checkout,clone: check return value of create_symref

It's unlikely that we would fail to create or update a
symbolic ref (especially HEAD), but if we do, we should
notice and complain. Note that there's no need to give more
details in our error message; create_symref will already
have done so.

While we're here, let's also fix a minor memory leak in
clone.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobuiltin/grep: add grep.fallbackToNoIndex config
Thomas Gummerer [Tue, 12 Jan 2016 10:40:26 +0000 (11:40 +0100)]
builtin/grep: add grep.fallbackToNoIndex config

Currently when git grep is used outside of a git repository without the
--no-index option git simply dies.  For convenience, add a
grep.fallbackToNoIndex configuration variable.  If set to true, git grep
behaves like git grep --no-index if it is run outside of a git
repository.  It defaults to false, preserving the current behavior.

Helped-by: Jeff King <redacted>
Helped-by: Eric Sunshine <redacted>
Signed-off-by: Thomas Gummerer <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot0060: verify that basename() and dirname() work as expected
Johannes Schindelin [Tue, 12 Jan 2016 07:57:57 +0000 (08:57 +0100)]
t0060: verify that basename() and dirname() work as expected

Unfortunately, some libgen implementations yield outcomes different
from what Git expects. For example, mingw-w64-crt provides a basename()
function, that shortens `path0/` to `path`!

So let's verify that the basename() and dirname() functions we use
conform to what Git expects.

Derived-from-code-by: Ramsay Jones <redacted>
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocompat/basename.c: provide a dirname() compatibility function
Johannes Schindelin [Tue, 12 Jan 2016 07:57:36 +0000 (08:57 +0100)]
compat/basename.c: provide a dirname() compatibility function

When there is no `libgen.h` to our disposal, we miss the `dirname()`
function.  Earlier we added basename() compatibility function for
the same reason at e1c06886 (compat: add a basename() compatibility
function, 2009-05-31).

So far, we only had one user of that function: credential-cache--daemon
(which was only compiled when Unix sockets are available, anyway). But
now we also have `builtin/am.c` as user, so we need it.

Since `dirname()` is a sibling of `basename()`, we simply put our very
own `gitdirname()` implementation next to `gitbasename()` and use it
if `NO_LIBGEN_H` has been set.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocompat/basename: make basename() conform to POSIX
Johannes Schindelin [Tue, 12 Jan 2016 07:57:30 +0000 (08:57 +0100)]
compat/basename: make basename() conform to POSIX

According to POSIX, basename("/path/") should return "path", not
"path/". Likewise, basename(NULL) and basename("") should both
return "." to conform.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoRefactor skipping DOS drive prefixes
Johannes Schindelin [Tue, 12 Jan 2016 07:57:22 +0000 (08:57 +0100)]
Refactor skipping DOS drive prefixes

Junio noticed that there is an implicit assumption in pretty much
all the code calling has_dos_drive_prefix(): it forces all of its
callsites to hardcode the knowledge that the DOS drive prefix is
always two bytes long.

While this assumption is pretty safe, we can still make the code
more readable and less error-prone by introducing a function that
skips the DOS drive prefix safely.

While at it, we change the has_dos_drive_prefix() return value: it
now returns the number of bytes to be skipped if there is a DOS
drive prefix.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoHandle more file writes correctly in shared repos
Johannes Schindelin [Mon, 11 Jan 2016 18:35:54 +0000 (19:35 +0100)]
Handle more file writes correctly in shared repos

In shared repositories, we have to be careful when writing files whose
permissions do not allow users other than the owner to write them.

In particular, we force the marks file of fast-export and the FETCH_HEAD
when fetching to be rewritten from scratch.

This commit does not touch other calls to fopen() that want to
write files:

 - commands that write to working tree files (core.sharedRepository
   does not affect permission bits of working tree files),
   e.g. .rej file created by "apply --reject", result of applying a
   previous conflict resolution by "rerere", "git merge-file".

 - git am, when splitting mails (git-am correctly cleans up its directory
   after finishing, so there is no need to share those files between users)

 - git submodule clone, when writing the .git file, because the file
   will not be overwritten

 - git_terminal_prompt() in compat/terminal.c, because it is not writing to
   a file at all

 - git diff --output, because the output file is clearly not intended to be
   shared between the users of the current repository

 - git fast-import, when writing a crash report, because the reports' file
   names are unique due to an embedded process ID

 - mailinfo() in mailinfo.c, because the output is clearly not intended to
   be shared between the users of the current repository

 - check_or_regenerate_marks() in remote-testsvn.c, because this is only
   used for Git's internal testing

 - git fsck, when writing lost&found blobs (this should probably be
   changed, but left as a low-hanging fruit for future contributors).

Note that this patch does not touch callers of write_file() and
write_file_gently(), which would benefit from the same scrutiny as
to usage in shared repositories.  Most notable users are branch,
daemon, submodule & worktree, and a worrisome call in transport.c
when updating one ref (which ignores the shared flag).

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot7810: correct --no-index test
Thomas Gummerer [Mon, 11 Jan 2016 21:26:19 +0000 (22:26 +0100)]
t7810: correct --no-index test

GIT_CEILING_DIRECTORIES doesn't prevent chdir up into another directory
while looking for a repository directory if it is equal to the current
directory.  Because of this, the test which claims to test the git grep
--no-index command outside of a repository actually tests it inside of a
repository.  The test_must_fail assertions still pass because the git
grep only looks at untracked files and therefore no file matches, but
not because it's run outside of a repository as it was originally
intended.

Set the GIT_CEILING_DIRECTORIES environment variable to the parent
directory of the directory in which the git grep command is executed, to
make sure it is actually run outside of a git repository.

In addition, the && chain was broken in a couple of places in the same
test, fix that.

Signed-off-by: Thomas Gummerer <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t9001-send-email.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 11 Jan 2016 13:34:09 +0000 (14:34 +0100)]
t/t9001-send-email.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
      perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
  done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agotest for '!' handling in rev-parse's named commits
Will Palmer [Sun, 10 Jan 2016 02:22:29 +0000 (19:22 -0700)]
test for '!' handling in rev-parse's named commits

In anticipation of extending this behaviour, add tests verifying the
handling of exclamation marks when looking up a commit "by name".

Specifically, as documented: '<rev>^{/!Message}' should fail, as the '!'
prefix is reserved; while '<rev>^{!!Message}' should search for a commit
whose message contains the string "!Message".

Signed-off-by: Will Palmer <redacted>
Signed-off-by: Stephen P. Smith <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t8003-blame-corner-cases.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:26 +0000 (12:06 +0100)]
t/t8003-blame-corner-cases.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7700-repack.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:25 +0000 (12:06 +0100)]
t/t7700-repack.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7602-merge-octopus-many.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:24 +0000 (12:06 +0100)]
t/t7602-merge-octopus-many.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7505-prepare-commit-msg-hook.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:23 +0000 (12:06 +0100)]
t/t7505-prepare-commit-msg-hook.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7504-commit-msg-hook.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:22 +0000 (12:06 +0100)]
t/t7504-commit-msg-hook.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7408-submodule-reference.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:21 +0000 (12:06 +0100)]
t/t7408-submodule-reference.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7406-submodule-update.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:20 +0000 (12:06 +0100)]
t/t7406-submodule-update.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7103-reset-bare.sh: use the $( ... ) construct for command substitution
Elia Pinto [Fri, 8 Jan 2016 11:06:19 +0000 (12:06 +0100)]
t/t7103-reset-bare.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agodocs: clarify that --depth for git-fetch works with newly initialized repos
Sebastian Schuberth [Fri, 8 Jan 2016 09:32:52 +0000 (10:32 +0100)]
docs: clarify that --depth for git-fetch works with newly initialized repos

The original wording sounded as if --depth could only be used to deepen or
shorten the history of existing repos. However, that is not the case. In a
workflow like

    $ git init
    $ git remote add origin https://github.com/git/git.git
    $ git fetch --depth=1

The newly initialized repo is properly created as a shallow repo.

Signed-off-by: Junio C Hamano <redacted>
10 years agodocs: say "commits" in the --depth option wording for git-clone
Sebastian Schuberth [Fri, 8 Jan 2016 09:18:21 +0000 (10:18 +0100)]
docs: say "commits" in the --depth option wording for git-clone

It is not wrong to talk about "revisions" here, but in this context
revisions are always commits, and that is how we already name it in the
git-fetch docs. So align the docs by always referring to "commits".

Signed-off-by: Junio C Hamano <redacted>
10 years agoRevert "dir.c: don't exclude whole dir prematurely if neg pattern may match"
Nguyễn Thái Ngọc Duy [Fri, 8 Jan 2016 12:05:25 +0000 (19:05 +0700)]
Revert "dir.c: don't exclude whole dir prematurely if neg pattern may match"

This reverts commit 57534ee77d22e725d971ee89c77dc6aad61c573f. The
feature added in that commit requires that patterns behave the same way
from anywhere. But some patterns can behave differently depending on
current "working" directory. The conditions to catch and avoid these
patterns are too loose. The untracked listing[1] and sparse-checkout
selection[2] can become incorrect as a result.

  [1] http://article.gmane.org/gmane.comp.version-control.git/283520
  [2] http://article.gmane.org/gmane.comp.version-control.git/283532

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7006-pager.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:50 +0000 (14:51 +0100)]
t/t7006-pager.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7004-tag.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:49 +0000 (14:51 +0100)]
t/t7004-tag.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7003-filter-branch.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:48 +0000 (14:51 +0100)]
t/t7003-filter-branch.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t7001-mv.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:47 +0000 (14:51 +0100)]
t/t7001-mv.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t6132-pathspec-exclude.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:46 +0000 (14:51 +0100)]
t/t6132-pathspec-exclude.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t6032-merge-large-rename.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:45 +0000 (14:51 +0100)]
t/t6032-merge-large-rename.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t6015-rev-list-show-all-parents.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:44 +0000 (14:51 +0100)]
t/t6015-rev-list-show-all-parents.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t6002-rev-list-bisect.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:43 +0000 (14:51 +0100)]
t/t6002-rev-list-bisect.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t6001-rev-list-graft.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:42 +0000 (14:51 +0100)]
t/t6001-rev-list-graft.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5900-repo-selection.sh: use the $( ... ) construct for command substitution
Elia Pinto [Thu, 7 Jan 2016 13:51:41 +0000 (14:51 +0100)]
t/t5900-repo-selection.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocommit: allow editing the commit message even in shared repos
Johannes Schindelin [Wed, 6 Jan 2016 13:09:43 +0000 (14:09 +0100)]
commit: allow editing the commit message even in shared repos

It was pointed out by Yaroslav Halchenko that the file containing the
commit message is writable only by the owner, which means that we have
to rewrite it from scratch in a shared repository.

Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agodocs: clarify that passing --depth to git-clone implies --single-branch
Sebastian Schuberth [Wed, 6 Jan 2016 13:06:47 +0000 (14:06 +0100)]
docs: clarify that passing --depth to git-clone implies --single-branch

It is confusing to document how --depth behaves as part of the
--single-branch docs. Better move that part to the --depth docs, saying
that it implies --single-branch by default.

Signed-off-by: Sebastian Schuberth <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoExpand documentation describing --signoff
David A. Wheeler [Tue, 5 Jan 2016 19:20:26 +0000 (14:20 -0500)]
Expand documentation describing --signoff

Modify various document (man page) files to explain
in more detail what --signoff means.

This was inspired by https://lwn.net/Articles/669976/ where
paulj noted, "adding [the] '-s' argument to [a] git commit
doesn't really mean you have even heard of the DCO...".
Extending git's documentation will make it easier to argue
that developers understood --signoff when they use it.

Signed-off-by: David A. Wheeler <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoreflog-walk: don't segfault on non-commit sha1's in the reflog
Dennis Kaarsemaker [Tue, 5 Jan 2016 21:12:10 +0000 (22:12 +0100)]
reflog-walk: don't segfault on non-commit sha1's in the reflog

git reflog (ab)uses the log machinery to display its list of log
entries. To do so it must fake commit parent information for the log
walker.

For refs in refs/heads this is no problem, as they should only ever
point to commits. Tags and other refs however can point to anything,
thus their reflog may contain non-commit objects.

To avoid segfaulting, we check whether reflog entries are commits before
feeding them to the log walker and skip any non-commits. This means that
git reflog output will be incomplete for such refs, but that's one step
up from segfaulting. A more complete solution would be to decouple git
reflog from the log walker machinery.

Signed-off-by: Dennis Kaarsemaker <redacted>
Helped-by: Nguyễn Thái Ngọc Duy <redacted>
Helped-by: Junio C Hamano <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agodo_compare_entry: use already-computed path
David Turner [Mon, 21 Dec 2015 22:34:20 +0000 (17:34 -0500)]
do_compare_entry: use already-computed path

In traverse_trees, we generate the complete traverse path for a
traverse_info.  Later, in do_compare_entry, we used to go do a bunch
of work to compare the traverse_info to a cache_entry's name without
computing that path.  But since we already have that path, we don't
need to do all that work.  Instead, we can just put the generated
path into the traverse_info, and do the comparison more directly.

We copy the path because prune_traversal might mutate `base`. This
doesn't happen in any codepaths where do_compare_entry is called,
but it's better to be safe.

This makes git checkout much faster -- about 25% on Twitter's
monorepo.  Deeper directory trees are likely to benefit more than
shallower ones.

Signed-off-by: David Turner <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot6050-replace: make failing editor test more robust
SZEDER Gábor [Tue, 5 Jan 2016 10:33:30 +0000 (11:33 +0100)]
t6050-replace: make failing editor test more robust

'git replace --edit' should error out when the invoked editor fails,
but the test checking this behavior would not notice if this weren't
the case.

The test in question, ever since it was added in 85f98fc037ae
(replace: add tests for --edit, 2014-05-17), has simulated a failing
editor in an unconventional way:

  test_must_fail env GIT_EDITOR='./fakeeditor;false' git replace --edit

I presume the reason for this unconventional editor was the fact that
'git replace --edit' requires the edited object to be different from
the original, but a mere 'false' as editor would leave the object
unchanged and 'git replace --edit' would error out anyway complaining
about the new and the original object files being the same.  Running
'fakeeditor' before 'false' was supposed to ensure that the object
file is modified and thus 'git replace --edit' errors out because of
the failed editor.

However, this editor doesn't actually modify the edited object,
because start_command() turns this editor into:

  /bin/sh -c './fakeeditor;false "$@"' './fakeeditor;false' \
          '.../.git/REPLACE_EDITOBJ'

This means that the test's fakeeditor script doesn't even get the path
of the object to be edited as argument, triggering error messages from
the commands executed inside the script ('sed' and 'mv'), and
ultimately leaving the object file unchanged.

If a patch were to remove the die() from the error path after
launch_editor(), the test would not catch it, because 'git replace'
would continue execution past launch_editor() and would error out a
bit later due to the unchanged edited object.  Though 'git replace'
would error out for the wrong reason, this would satisfy
'test_must_fail' just as well, and the test would succeed leaving the
undesired change unnoticed.

Create a proper failing fake editor script for this test to ensure
that the edited object is in fact modified and 'git replace --edit'
won't error out because the new and original object files are the
same.

Signed-off-by: SZEDER Gábor <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agofor-each-ref: document `creatordate` and `creator` fields
Eric Wong [Tue, 5 Jan 2016 03:51:57 +0000 (03:51 +0000)]
for-each-ref: document `creatordate` and `creator` fields

These were introduced back in 2006 at 3175aa1ec28c but
never documented.

Signed-off-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoGit 2.7
Junio C Hamano [Mon, 4 Jan 2016 22:08:04 +0000 (14:08 -0800)]
Git 2.7

Signed-off-by: Junio C Hamano <redacted>
10 years agoSync with 2.6.5
Junio C Hamano [Mon, 4 Jan 2016 22:06:59 +0000 (14:06 -0800)]
Sync with 2.6.5

10 years agoGit 2.6.5
Junio C Hamano [Mon, 4 Jan 2016 22:06:00 +0000 (14:06 -0800)]
Git 2.6.5

Signed-off-by: Junio C Hamano <redacted>
10 years agoMerge branch 'jk/pending-keep-tag-name' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:03:07 +0000 (14:03 -0800)]
Merge branch 'jk/pending-keep-tag-name' into maint

History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
  revision.c: propagate tag names from pending array

10 years agoMerge branch 'jk/symbolic-ref-maint' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:58 +0000 (14:02 -0800)]
Merge branch 'jk/symbolic-ref-maint' into maint

"git symbolic-ref" forgot to report a failure with its exit status.

* jk/symbolic-ref-maint:
  t1401: test reflog creation for git-symbolic-ref
  symbolic-ref: propagate error code from create_symref()

10 years agoMerge branch 'jk/ident-loosen-getpwuid' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:57 +0000 (14:02 -0800)]
Merge branch 'jk/ident-loosen-getpwuid' into maint

When getpwuid() on the system returned NULL (e.g. the user is not
in the /etc/passwd file or other uid-to-name mappings), the
codepath to find who the user is to record it in the reflog barfed
and died.  Loosen the check in this codepath, which already accepts
questionable ident string (e.g. host part of the e-mail address is
obviously bogus), and in general when we operate fmt_ident() function
in non-strict mode.

* jk/ident-loosen-getpwuid:
  ident: loosen getpwuid error in non-strict mode
  ident: keep a flag for bogus default_email
  ident: make xgetpwuid_self() a static local helper

10 years agoMerge branch 'jk/send-email-ssl-errors' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:55 +0000 (14:02 -0800)]
Merge branch 'jk/send-email-ssl-errors' into maint

Improve error reporting when SMTP TLS fails.

* jk/send-email-ssl-errors:
  send-email: enable SSL level 1 debug output

10 years agoMerge branch 'sg/completion-no-column' into maint
Junio C Hamano [Mon, 4 Jan 2016 22:02:45 +0000 (14:02 -0800)]
Merge branch 'sg/completion-no-column' into maint

The completion script (in contrib/) used to list "git column"
(which is not an end-user facing command) as one of the choices

* sg/completion-no-column:
  completion: remove 'git column' from porcelain commands

10 years agot/t5710-info-alternate.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:51 +0000 (10:10 +0100)]
t/t5710-info-alternate.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5700-clone-reference.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:50 +0000 (10:10 +0100)]
t/t5700-clone-reference.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5601-clone.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:49 +0000 (10:10 +0100)]
t/t5601-clone.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5570-git-daemon.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:48 +0000 (10:10 +0100)]
t/t5570-git-daemon.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5550-http-fetch-dumb.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:47 +0000 (10:10 +0100)]
t/t5550-http-fetch-dumb.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5538-push-shallow.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:46 +0000 (10:10 +0100)]
t/t5538-push-shallow.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5537-fetch-shallow.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:45 +0000 (10:10 +0100)]
t/t5537-fetch-shallow.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5532-fetch-proxy.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:44 +0000 (10:10 +0100)]
t/t5532-fetch-proxy.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5530-upload-pack-error.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:43 +0000 (10:10 +0100)]
t/t5530-upload-pack-error.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5522-pull-symlink.sh: use the $( ... ) construct for command substitution
Elia Pinto [Mon, 4 Jan 2016 09:10:42 +0000 (10:10 +0100)]
t/t5522-pull-symlink.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agogit-send-email: do not double-escape quotes from mutt
Eric Wong [Mon, 4 Jan 2016 20:53:30 +0000 (20:53 +0000)]
git-send-email: do not double-escape quotes from mutt

mutt saves aliases with escaped quotes in the form of:

alias dot \"Dot U. Sir\" <redacted>

When we pass through our sanitize_address routine,
we end up with double-escaping:

 To: "\\\"Dot U. Sir\\\" <redacted>

Remove the escaping in mutt only for now, as I am not sure
if other mailers can do this or if this is better fixed in
sanitize_address.

Cc: Remi Lespinet <redacted>
Cc: Matthieu Moy <redacted>
Signed-off-by: Eric Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agobswap: add NO_UNALIGNED_LOADS define
Jeff King [Tue, 29 Dec 2015 06:36:00 +0000 (01:36 -0500)]
bswap: add NO_UNALIGNED_LOADS define

The byte-swapping code automatically decides, based on the
platform, whether it is sensible to cast and do a potentially
unaligned ntohl(), or to pick individual bytes out of an
array.

It can be handy to override this decision, though, when
turning on compiler flags that will complain about unaligned
loads (such as -fsanitize=undefined). This patch adds a
macro check to make this possible.

There's no nice Makefile knob here; this is for prodding at
Git's internals, and anybody using it can set
"-DNO_UNALIGNED_LOADS" in the same place they are setting up
"-fsanitize".

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoavoid shifting signed integers 31 bits
Jeff King [Tue, 29 Dec 2015 06:35:46 +0000 (01:35 -0500)]
avoid shifting signed integers 31 bits

We sometimes use 32-bit unsigned integers as bit-fields.
It's fine to access the MSB, because it's unsigned. However,
doing so as "1 << 31" is wrong, because the constant "1" is
a signed int, and we shift into the sign bit, causing
undefined behavior.

We can fix this by using "1U" as the constant.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agol10n: ko.po: Add Korean translation
Changwoo Ryu [Sun, 3 Jan 2016 10:07:29 +0000 (19:07 +0900)]
l10n: ko.po: Add Korean translation

Signed-off-by: Changwoo Ryu <redacted>
Signed-off-by: Hyunjun Kim <redacted>
10 years agoMerge tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po
Junio C Hamano [Sat, 2 Jan 2016 19:31:43 +0000 (11:31 -0800)]
Merge tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po

l10n-2.7.0-rnd2+de

* tag 'l10n-2.7.0-rnd2+de' of git://github.com/git-l10n/git-po:
  l10n: de.po: translate 68 new messages
  l10n: de.po: improve some translations

10 years agouser-manual: add addition gitweb information
Stephen P. Smith [Wed, 30 Dec 2015 23:25:20 +0000 (16:25 -0700)]
user-manual: add addition gitweb information

Rework the section on gitweb to add information about the cgi script
and the instaweb command.

Signed-off-by: Stephen P. Smith <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agouser-manual: add section documenting shallow clones
Stephen P. Smith [Wed, 30 Dec 2015 00:03:50 +0000 (17:03 -0700)]
user-manual: add section documenting shallow clones

Signed-off-by: Stephen P. Smith <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agodir: free untracked cache when removing it
Christian Couder [Tue, 29 Dec 2015 07:09:25 +0000 (08:09 +0100)]
dir: free untracked cache when removing it

Signed-off-by: Christian Couder <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoglossary: define the term shallow clone
Stephen P. Smith [Tue, 29 Dec 2015 18:54:35 +0000 (11:54 -0700)]
glossary: define the term shallow clone

There are several places in the documentation that
the term shallow clone is used. Defining the term
enables its use elsewhere with a known definition.

Signed-off-by: Stephen P. Smith <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agorun-command: don't warn on SIGPIPE deaths
Jeff King [Tue, 29 Dec 2015 08:12:22 +0000 (03:12 -0500)]
run-command: don't warn on SIGPIPE deaths

When git executes a sub-command, we print a warning if the
command dies due to a signal, but make an exception for
"uninteresting" cases like SIGINT and SIGQUIT (since the
user presumably just hit ^C).

We should make a similar exception for SIGPIPE, because it's
an expected and uninteresting return in most cases; it
generally means the user quit the pager before git had
finished generating all output.  This used to be very hard
to trigger in practice, because:

  1. We only complain if we see a real SIGPIPE death, not
     the shell-induced 141 exit code. This means that
     anything we run via the shell does not trigger the
     warning, which includes most non-trivial aliases.

  2. The common case for SIGPIPE is the user quitting the
     pager before git has finished generating all output.
     But if the user triggers a pager with "-p", we redirect
     the git wrapper's stderr to that pager, too.  Since the
     pager is dead, it means that the message goes nowhere.

  3. You can see it if you run your own pager, like
     "git foo | head". But that only happens if "foo" is a
     non-builtin (so it doesn't work with "log", for
     example).

However, it may become more common after 86d26f2, which
teaches alias to re-exec builtins rather than running them
in the same process. This case doesn't trigger (1), as we
don't need a shell to run a git command. It doesn't trigger
(2), because the pager is not started by the original git,
but by the inner re-exec of git. And it doesn't trigger (3),
because builtins are treated more like non-builtins in this
case.

Given how flaky this message already is (e.g., you cannot
even know whether you will see it, as git optimizes out some
shell invocations behind the scenes based on the contents of
the command!), and that it is unlikely to ever provide
useful information, let's suppress it for all cases of
SIGPIPE.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agol10n: de.po: translate 68 new messages
Ralf Thielow [Tue, 22 Dec 2015 17:08:06 +0000 (18:08 +0100)]
l10n: de.po: translate 68 new messages

Translate 68 new messages came from git.pot update in
f4f2c8f (l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)) and
2c0ca05 (l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)).

Signed-off-by: Ralf Thielow <redacted>
Acked-by: Matthias Rüster <redacted>
10 years agol10n: de.po: improve some translations
Ralf Thielow [Thu, 29 Oct 2015 21:18:32 +0000 (22:18 +0100)]
l10n: de.po: improve some translations

Signed-off-by: Ralf Thielow <redacted>
Acked-by: Phillip Sz <redacted>
10 years agocreate_symref: write reflog while holding lock
Jeff King [Tue, 29 Dec 2015 05:57:25 +0000 (00:57 -0500)]
create_symref: write reflog while holding lock

We generally hold a lock on the matching ref while writing
to its reflog; this prevents two simultaneous writers from
clobbering each other's reflog lines (it does not even have
to be two symref updates; because we don't hold the lock, we
could race with somebody writing to the pointed-to ref via
HEAD, for example).

We can fix this by writing the reflog before we commit the
lockfile. This runs the risk of writing the reflog but
failing the final rename(), but at least we now err on the
same side as the rest of the ref code.

Noticed-by: Michael Haggerty <redacted>
Signed-off-by: Jeff King <redacted>
Reviewed-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocreate_symref: use existing ref-lock code
Jeff King [Tue, 29 Dec 2015 05:57:01 +0000 (00:57 -0500)]
create_symref: use existing ref-lock code

The create_symref() function predates the existence of
"struct lock_file", let alone the more recent "struct
ref_lock". Instead, it just does its own manual dot-locking.
Besides being more code, this has a few downsides:

 - if git is interrupted while holding the lock, we don't
   clean up the lockfile

 - we don't do the usual directory/filename conflict check.
   So you can sometimes create a symref "refs/heads/foo/bar",
   even if "refs/heads/foo" exists (namely, if the refs are
   packed and we do not hit the d/f conflict in the
   filesystem).

This patch refactors create_symref() to use the "struct
ref_lock" interface, which handles both of these things.
There are a few bonus cleanups that come along with it:

 - we leaked ref_path in some error cases

 - the symref contents were stored in a fixed-size buffer,
   putting an artificial (albeit large) limitation on the
   length of the refname. We now write through fprintf, and
   handle refnames of any size.

 - we called adjust_shared_perm only after the file was
   renamed into place, creating a potential race with
   readers in a shared repository. The lockfile code now
   handles this when creating the lockfile, making it
   atomic.

 - the legacy prefer_symlink_refs path did not do any
   locking at all. Admittedly, it is not atomic from a
   reader's perspective (as it unlinks and re-creates the
   symlink to overwrite), but at least it cannot conflict
   with other writers now.

 - the result of this patch is hopefully more readable. It
   eliminates three goto labels. Two were for error checking
   that is now simplified, and the third was to reach shared
   code that has been pulled into its own function.

Signed-off-by: Jeff King <redacted>
Reviewed-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agocreate_symref: modernize variable names
Jeff King [Tue, 29 Dec 2015 05:56:44 +0000 (00:56 -0500)]
create_symref: modernize variable names

Once upon a time, create_symref() was used only to point
HEAD at a branch name, and the variable names reflect that
(e.g., calling the path git_HEAD). However, it is much more
generic these days (and has been for some time). Let's
update the variable names to make it easier to follow:

  - `ref_target` is now just `refname`. This is closer to
    the `ref` that is already in `cache.h`, but with the
    extra twist that "name" makes it clear this is the name
    and not a ref struct. Dropping "target" hopefully makes
    it clear that we are talking about the symref itself,
    not what it points to.

  - `git_HEAD` is now `ref_path`; the on-disk path
    corresponding to `ref`.

  - `refs_heads_master` is now just `target`; i.e., what the
    symref points at. This term also matches what is in
    the symlink(2) manpage (at least on Linux).

  - the buffer to hold the symref file's contents was simply
    called `ref`. It's now `buf` (admittedly also generic,
    but at least not actively introducing confusion with the
    other variable holding the refname).

Signed-off-by: Jeff King <redacted>
Reviewed-by: Michael Haggerty <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agoGit 2.7-rc3
Junio C Hamano [Mon, 28 Dec 2015 22:00:52 +0000 (14:00 -0800)]
Git 2.7-rc3

Signed-off-by: Junio C Hamano <redacted>
10 years agoMerge branch 'sh/p4-multi-depot'
Junio C Hamano [Mon, 28 Dec 2015 21:58:57 +0000 (13:58 -0800)]
Merge branch 'sh/p4-multi-depot'

"git p4" when interacting with multiple depots at the same time
used to incorrectly drop changes.

* sh/p4-multi-depot:
  git-p4: reduce number of server queries for fetches
  git-p4: support multiple depot paths in p4 submit
  git-p4: failing test case for skipping changes with multiple depots

10 years agoMerge branch 'jk/pending-keep-tag-name'
Junio C Hamano [Mon, 28 Dec 2015 21:58:03 +0000 (13:58 -0800)]
Merge branch 'jk/pending-keep-tag-name'

History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
  revision.c: propagate tag names from pending array

10 years agoMerge branch 'jk/symbolic-ref-maint'
Junio C Hamano [Mon, 28 Dec 2015 21:57:24 +0000 (13:57 -0800)]
Merge branch 'jk/symbolic-ref-maint'

"git symbolic-ref" forgot to report a failure with its exit status.

* jk/symbolic-ref-maint:
  t1401: test reflog creation for git-symbolic-ref
  symbolic-ref: propagate error code from create_symref()

10 years agoMerge tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po
Junio C Hamano [Mon, 28 Dec 2015 21:53:47 +0000 (13:53 -0800)]
Merge tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po

l10n-2.7.0-rnd2

* tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: ru.po: update Russian translation
  l10n: Updated Bulgarian translation of git (2477t,0f,0u)
  l10n: ca.po: update translation
  l10n: zh_CN: for git v2.7.0 l10n round 2
  l10n: sv.po: Update Swedish translation (2477t0f0u)
  l10n: sv: Fix bad translation
  l10n: fr.po v2.7.0 round 2 (2477t)
  l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)
  l10n: zh_CN: for git v2.7.0 l10n round 1
  l10n: ca.po: update translation
  l10n: fr v2.7.0 round 1 (2477t)
  l10n: Updated Bulgarian translation of git (2477t,0f,0u)
  l10n: sv.po: Update Swedish translation (2477t0f0u)
  l10n: vi.po: Updated translation (2477t)
  l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed)
  l10n: fr.po: Fix typo
  l10n: fr.po: Fix typo

10 years agouser-manual: remove temporary branch entry from todo list
Stephen P. Smith [Mon, 28 Dec 2015 20:16:44 +0000 (13:16 -0700)]
user-manual: remove temporary branch entry from todo list

In the section on "How to check out a different version of a
project" the "new" branch is used as a temporary branch.  A detached
HEAD was not used since it was a new feature introduced just a
couple weeks prior.

The section could be changed to use and explain a detached HEAD,
except that would increase the learning curve early in the manual.
Detached HEADs are discussed a couple sections later under
"Examining an old version without creating a new branch".

Let's declare that it is a bad idea to rewrite the example that
uses a temporary branch to do the sightseeing on a detached HEAD.

Signed-off-by: Stephen P. Smith <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5517-push-mirror.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 23 Dec 2015 13:45:58 +0000 (14:45 +0100)]
t/t5517-push-mirror.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5516-fetch-push.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 23 Dec 2015 13:45:57 +0000 (14:45 +0100)]
t/t5516-fetch-push.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5515-fetch-merge-logic.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 23 Dec 2015 13:45:56 +0000 (14:45 +0100)]
t/t5515-fetch-merge-logic.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5510-fetch.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 23 Dec 2015 13:45:55 +0000 (14:45 +0100)]
t/t5510-fetch.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
10 years agot/t5506-remote-groups.sh: use the $( ... ) construct for command substitution
Elia Pinto [Wed, 23 Dec 2015 13:45:54 +0000 (14:45 +0100)]
t/t5506-remote-groups.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
perl -i -pe 'BEGIN{undef $/;} s/`(.+?)`/\$(\1)/smg'  "${_f}"
done

and then carefully proof-read.

Signed-off-by: Elia Pinto <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT