Commit graph

40871 commits

Author SHA1 Message Date
Junio C Hamano 6525496172 Merge branch 'sg/wt-status-header-inclusion'
* sg/wt-status-header-inclusion:
  wt-status: move #include "pathspec.h" to the header
2015-08-26 15:45:38 -07:00
Junio C Hamano cfcd38f552 Merge branch 'as/docfix-reflog-expire-unreachable'
* as/docfix-reflog-expire-unreachable:
  Documentation/config: fix inconsistent label on gc.*.reflogExpireUnreachable
2015-08-26 15:45:37 -07:00
Junio C Hamano 7205e220e8 Merge branch 'sg/t3020-typofix'
* sg/t3020-typofix:
  t3020: fix typo in test description
2015-08-26 15:45:36 -07:00
Junio C Hamano 88bd19be2f Merge branch 'jc/calloc-pathspec'
* jc/calloc-pathspec:
  ps_matched: xcalloc() takes nmemb and then element size
2015-08-26 15:45:34 -07:00
Junio C Hamano a5315dd17d Merge branch 'dt/untracked-sparse'
Test update.

* dt/untracked-sparse:
  t7063: use --force-untracked-cache to speed up a bit
2015-08-26 15:45:33 -07:00
Junio C Hamano 74702c3825 Merge branch 'pt/am-builtin'
Rewrite "am" in "C".

* pt/am-builtin:
  i18n: am: fix typo in description of -b option
2015-08-26 15:45:33 -07:00
Junio C Hamano b7d2a15b9f Merge branch 'pt/am-builtin-abort-fix'
"git am" that was recently reimplemented in C had a performance
regression in "git am --abort" that goes back to the version before
an attempted (and failed) patch application.

* pt/am-builtin-abort-fix:
  am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
2015-08-26 15:45:32 -07:00
Junio C Hamano 788f211966 Merge branch 'po/po-readme'
* po/po-readme:
  po/README: Update directions for l10n contributors
2015-08-26 15:45:32 -07:00
Junio C Hamano 629ac65f68 Merge branch 'jv/send-email-selective-smtp-auth'
"git send-email" learned a new option --smtp-auth to limit the SMTP
AUTH mechanisms to be used to a subset of what the system library
supports.

* jv/send-email-selective-smtp-auth:
  send-email: provide whitelist of SMTP AUTH mechanisms
2015-08-26 15:45:31 -07:00
Junio C Hamano ed070a4007 Merge branch 'ep/http-configure-ssl-version'
A new configuration variable http.sslVersion can be used to specify
what specific version of SSL/TLS to use to make a connection.

* ep/http-configure-ssl-version:
  http: add support for specifying the SSL version
2015-08-26 15:45:31 -07:00
Junio C Hamano 51e83a4898 Merge branch 'ss/fix-config-fd-leak'
* ss/fix-config-fd-leak:
  config: close config file handle in case of error
2015-08-26 15:45:30 -07:00
Jiang Xin 1fb5a0ea96 i18n: am: fix typo in description of -b option
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-26 12:51:43 -07:00
Christian Couder 6262fe9ca3 trailer: retitle a test and correct an in-comment message
Signed-off-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-26 12:16:56 -07:00
Brett Randall 486e1e1223 git-svn doc: mention "svn-remote.<name>.include-paths"
Mention the configuration variable in a way similar to how
"svn-remote.<name>.ignore-paths" is mentioned.

Signed-off-by: Brett Randall <javabrett@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-26 10:27:26 -07:00
Junio C Hamano 33f2c4ff7b Sync with maint
* maint:
  pull: pass upload_pack only when it was given
2015-08-25 16:09:30 -07:00
Junio C Hamano 52f6893d35 Merge branch 'jk/guess-repo-name-regression-fix' into maint
"git clone $URL" in recent releases of Git contains a regression in
the code that invents a new repository name incorrectly based on
the $URL.  This has been corrected.

* jk/guess-repo-name-regression-fix:
  clone: use computed length in guess_dir_name
  clone: add tests for output directory
2015-08-25 16:09:17 -07:00
Junio C Hamano 84deb3eac5 Merge branch 'jk/test-with-x' into maint
Running tests with the "-x" option to make them verbose had some
unpleasant interactions with other features of the test suite.

* jk/test-with-x:
  test-lib: disable trace when test is not verbose
  test-lib: turn off "-x" tracing during chain-lint check
2015-08-25 16:09:16 -07:00
Junio C Hamano 7a23807407 Merge branch 'sb/check-return-from-read-ref' into maint
* sb/check-return-from-read-ref:
  transport-helper: die on errors reading refs.
2015-08-25 16:09:16 -07:00
Junio C Hamano 425a4c7734 Merge branch 'mm/pull-upload-pack' into maint
"git pull" in recent releases of Git has a regression in the code
that allows custom path to the --upload-pack=<program>.  This has
been corrected.

Note that this is irrelevant for 'master' with "git pull" rewritten
in C.

* mm/pull-upload-pack:
  pull: pass upload_pack only when it was given
  pull.sh: quote $upload_pack when passing it to git-fetch
2015-08-25 16:09:15 -07:00
Junio C Hamano 13e0e28f53 pull: pass upload_pack only when it was given
The upload_pack shell variable is initialized to an empty string, so
conditional expansion with ${upload_pack+"$upload_pack"} would not
work very well.  You need a colon there.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 16:08:58 -07:00
Junio C Hamano 8da8889a4b Fifth batch for 2.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 15:00:25 -07:00
Junio C Hamano 9b8d731995 Merge branch 'cb/open-noatime-clear-errno'
When trying to see that an object does not exist, a state errno
leaked from our "first try to open a packfile with O_NOATIME and
then if it fails retry without it" logic on a system that refuses
O_NOATIME.  This confused us and caused us to die, saying that the
packfile is unreadable, when we should have just reported that the
object does not exist in that packfile to the caller.

* cb/open-noatime-clear-errno:
  git_open_noatime: return with errno=0 on success
2015-08-25 14:57:10 -07:00
Junio C Hamano db86e61cbb Merge branch 'mh/tempfile'
The "lockfile" API has been rebuilt on top of a new "tempfile" API.

* mh/tempfile:
  credential-cache--daemon: use tempfile module
  credential-cache--daemon: delete socket from main()
  gc: use tempfile module to handle gc.pid file
  lock_repo_for_gc(): compute the path to "gc.pid" only once
  diff: use tempfile module
  setup_temporary_shallow(): use tempfile module
  write_shared_index(): use tempfile module
  register_tempfile(): new function to handle an existing temporary file
  tempfile: add several functions for creating temporary files
  prepare_tempfile_object(): new function, extracted from create_tempfile()
  tempfile: a new module for handling temporary files
  commit_lock_file(): use get_locked_file_path()
  lockfile: add accessor get_lock_file_path()
  lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()
  create_bundle(): duplicate file descriptor to avoid closing it twice
  lockfile: move documentation to lockfile.h and lockfile.c
2015-08-25 14:57:09 -07:00
Junio C Hamano 424f89f098 Merge branch 'pt/am-builtin-options'
After "git am --opt1" stops, running "git am --opt2" pays attention
to "--opt2" only for the patch that caused the original invocation
to stop.

* pt/am-builtin-options:
  am: let --signoff override --no-signoff
  am: let command-line options override saved options
  test_terminal: redirect child process' stdin to a pty
2015-08-25 14:57:08 -07:00
Junio C Hamano 080cc64663 Merge branch 'dt/refs-pseudo'
To prepare for allowing a different "ref" backend to be plugged in
to the system, update_ref()/delete_ref() have been taught about
ref-like things like MERGE_HEAD that are per-worktree (they will
always be written to the filesystem inside $GIT_DIR).

* dt/refs-pseudo:
  pseudoref: check return values from read_ref()
  sequencer: replace write_cherry_pick_head with update_ref
  bisect: use update_ref
  pseudorefs: create and use pseudoref update and delete functions
  refs: add ref_type function
  refs: introduce pseudoref and per-worktree ref concepts
2015-08-25 14:57:08 -07:00
Junio C Hamano 32561f5dd3 Merge branch 'dt/notes-multiple'
When linked worktree is used, simultaneous "notes merge" instances
for the same ref in refs/notes/* are prevented from stomping on
each other.

* dt/notes-multiple:
  notes: handle multiple worktrees
  worktrees: add find_shared_symref
2015-08-25 14:57:08 -07:00
Junio C Hamano 5d5be8167d Merge branch 'nd/dwim-wildcards-as-pathspecs'
Test updates for Windows.

* nd/dwim-wildcards-as-pathspecs:
  t2019: skip test requiring '*' in a file name non Windows
2015-08-25 14:57:07 -07:00
Junio C Hamano 1302c9f514 Merge branch 'jk/long-error-messages'
The codepath to produce error messages had a hard-coded limit to
the size of the message, primarily to avoid memory allocation while
calling die().

* jk/long-error-messages:
  vreportf: avoid intermediate buffer
  vreportf: report to arbitrary filehandles
2015-08-25 14:57:06 -07:00
Junio C Hamano b590720f2c Merge branch 'ee/clean-remove-dirs'
Test updates for Windows.

* ee/clean-remove-dirs:
  t7300-clean: require POSIXPERM for chmod 0 test
2015-08-25 14:57:06 -07:00
Junio C Hamano 3b281d1281 Merge branch 'jh/strbuf-read-use-read-in-full'
strbuf_read() used to have one extra iteration (and an unnecessary
strbuf_grow() of 8kB), which was eliminated.

* jh/strbuf-read-use-read-in-full:
  strbuf_read(): skip unnecessary strbuf_grow() at eof
2015-08-25 14:57:06 -07:00
Junio C Hamano 3acf8dd887 builtin/log.c: minor reformat
Two logical lines that were not overly long was split in the middle,
which made them read worse.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 13:11:21 -07:00
Junio C Hamano 1f76a10b2d write_file(): drop caller-supplied LF from calls to create a one-liner file
All of the callsites covered by this change call write_file() or
write_file_gently() to create a one-liner file.  Drop the caller
supplied LF and let these callees to append it as necessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 12:49:19 -07:00
Junio C Hamano e7ffa38c6e write_file_v(): do not leave incomplete line at the end
All existing callers to this function use it to produce a text file
or an empty file, and a new callsite that mimick them must end their
payload with a LF.  If they forget to do so, the resulting file will
end with an incomplete line.

Teach write_file_v() to complete the incomplete line, if exists, so
that the callers do not have to.

With this, the caller-side fix in builtin/am.c becomes unnecessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 12:48:39 -07:00
Eric Sunshine 82aec45b7d generate-cmdlist: re-implement as shell script
527ec39 (generate-cmdlist: parse common group commands, 2015-05-21)
replaced generate-cmdlist.sh with a more functional Perl version,
generate-cmdlist.perl. The Perl version gleans named tags from a new
"common groups" section in command-list.txt and recognizes those
tags in "command list" section entries in place of the old 'common'
tag. This allows git-help to, not only recognize, but also group
common commands.

Although the tests require Perl, 527ec39 creates an unconditional
dependence upon Perl in the build system itself, which can not be
overridden with NO_PERL. Such a dependency may be undesirable; for
instance, the 'git-lite' package in the FreeBSD ports tree is
intended as a minimal Git installation (which may, for example, be
useful on servers needing only local clone and update capability),
which, historically, has not depended upon Perl[1].

Therefore, revive generate-cmdlist.sh and extend it to recognize
"common groups" and its named tags. Retire generate-cmdlist.perl.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/275905/focus=276132

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 11:24:31 -07:00
Nguyễn Thái Ngọc Duy 82fde87ff3 setup: update the right file in multiple checkouts
This code is introduced in 23af91d (prune: strategies for linked
checkouts - 2014-11-30), and it's supposed to implement this rule from
that commit's message:

 - linked checkouts are supposed to keep its location in $R/gitdir up
   to date. The use case is auto fixup after a manual checkout move.

Note the name, "$R/gitdir", not "$R/gitfile". Correct the path to be
updated accordingly.

While at there, make sure I/O errors are not silently dropped.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 09:39:08 -07:00
SZEDER Gábor 2bd07065c3 describe --contains: default to HEAD when no commit-ish is given
'git describe --contains' doesn't default to HEAD when no commit is
given, and it doesn't produce any output, not even an error:

  ~/src/git ((v2.5.0))$ ./git describe --contains
  ~/src/git ((v2.5.0))$ ./git describe --contains HEAD
  v2.5.0^0

Unlike other 'git describe' options, the '--contains' code path is
implemented by calling 'name-rev' with a bunch of options plus all the
commit-ishes that were passed to 'git describe'.  If no commit-ish was
present, then 'name-rev' got invoked with none, which then leads to the
behavior illustrated above.

Porcelain commands usually default to HEAD when no commit-ish is given,
and 'git describe' already does so in all other cases, so it should do
so with '--contains' as well.

Pass HEAD to 'name-rev' when no commit-ish is given on the command line
to make '--contains' behave consistently with other 'git describe'
options.  While at it, use argv_array_pushv() instead of the loop to
pass commit-ishes to 'git name-rev'.

'git describe's short help already indicates that the commit-ish is
optional, but the synopsis in the man page doesn't, so update it
accordingly as well.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-25 09:35:13 -07:00
Ray Chen 667599e825 l10n: zh_CN: Update Git Glossary: "commit message"
Add "commit message" to glossary.  Translate it as "提交信息".

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-25 09:47:50 +08:00
Junio C Hamano 12d6ce1dba write_file(): drop "fatal" parameter
All callers except three passed 1 for the "fatal" parameter to ask
this function to die upon error, but to a casual reader of the code,
it was not all obvious what that 1 meant.  Instead, split the
function into two based on a common write_file_v() that takes the
flag, introduce write_file_gently() as a new way to attempt creating
a file without dying on error, and make three callers to call it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 13:09:02 -07:00
Junio C Hamano 57c867efe4 builtin/am: make sure state files are text
We forgot to terminate the payload given to write_file() with LF,
resulting in files that end with an incomplete line.  Teach the
wrappers builtin/am uses to make sure it adds LF at the end as
necessary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 13:01:59 -07:00
Junio C Hamano 25b763ba7a builtin/am: introduce write_state_*() helper functions
There are many calls to write_file() that repeat the same pattern in
the implementation of the builtin version of "am".  They all share
the same traits, i.e they

 - produce a text file with a single string in it;

 - have enough information to produce the entire contents of that
   file;

 - generate the pathname of the file by making a call to am_path(); and

 - they ask write_file() to die() upon failure.

The slight differences among the call sites throw them into roughly
three categories:

 - many write either "t" or "f" based on a boolean value to a file;

 - some write the integer value in decimal text;

 - some others write more general string, e.g. an object name in
   hex, an empty string (i.e. the presense of the file itself serves
   as a flag), etc.

Introduce three helpers, write_state_bool(), write_state_count() and
write_state_text(), to reduce direct calls to write_file().

This is a preparatory step for the next step to ensure that no
"state" file this command leaves in $GIT_DIR is with an incomplete
line at the end.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 11:18:59 -07:00
Jeff King 2aea7a51a1 rev-list: make it obvious that we do not support notes
The rev-list command does not have the internal
infrastructure to display notes. Running:

  git rev-list --notes HEAD

will silently ignore the "--notes" option. Running:

  git rev-list --notes --grep=. HEAD

will crash on an assert. Running:

  git rev-list --format=%N HEAD

will place a literal "%N" in the output (it does not even
expand to an empty string).

Let's have rev-list tell the user that it cannot fill the
user's request, rather than silently producing wrong data.
Likewise, let's remove mention of the notes options from the
rev-list documentation.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 10:33:15 -07:00
Jeff King 9e9de18f1a config: silence warnings for command names with invalid keys
When we are running the git command "foo", we may have to
look up the config keys "pager.foo" and "alias.foo". These
config schemes are mis-designed, as the command names can be
anything, but the config syntax has some restrictions. For
example:

  $ git foo_bar
  error: invalid key: pager.foo_bar
  error: invalid key: alias.foo_bar
  git: 'foo_bar' is not a git command. See 'git --help'.

You cannot name an alias with an underscore. And if you have
an external command with one, you cannot configure its
pager.

In the long run, we may develop a different config scheme
for these features. But in the near term (and because we'll
need to support the existing scheme indefinitely), we should
at least squelch the error messages shown above.

These errors come from git_config_parse_key. Ideally we
would pass a "quiet" flag to the config machinery, but there
are many layers between the pager code and the key parsing.
Passing a flag through all of those would be an invasive
change.

Instead, let's provide a config function to report on
whether a key is syntactically valid, and have the pager and
alias code skip lookup for bogus keys. We can build this
easily around the existing git_config_parse_key, with two
minor modifications:

  1. We now handle a NULL store_key, to validate but not
     write out the normalized key.

  2. We accept a "quiet" flag to avoid writing to stderr.
     This doesn't need to be a full-blown public "flags"
     field, because we can make the existing implementation
     a static helper function, keeping the mess contained
     inside config.c.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-24 08:52:23 -07:00
Ray Chen 12e59059ee l10n: zh_CN: Update Git Glossary: pickaxe
Translate the term "pickaxe" as "挖掘".

Initially proposed by @louy2 .

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-23 15:12:22 +08:00
Ray Chen e397e7e353 l10n: zh_CN: Update Git Glossary: fork
Remove "复刻" from translation option list of "fork", keeping "派生"
as the only one.

In Git context, by talking about the term "fork", one usually mean the
procedure that divides a branch into two or more history lines.  That
is quite like the "fork" concept in programming, which split a process
into two or more independent processes.

On the other hand, "复刻" by itself means "copy" or "mirror".  It is
considered more suitable for describing the procedure like
"fork a repository", which is common on public repository hosting
services, such as GitHub.  However, this is beyond the scope of
core-Git.  As a l10n work for core-Git, "复刻" should be removed here.

There used to be another option - "分岔".  Its a good idea to
translate "fork point" as "分岔点".  However, "派生点" is as good,
too.  So this option is finally discarded.

Also fix a relevant translation issue which was introduced in
`160fb2b`.

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-23 15:12:22 +08:00
Ray Chen 933c015e37 l10n: zh_CN: Update Git Glossary: tag
Add verb form translation of tag.

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-23 15:12:22 +08:00
Ray Chen 755c831b9f l10n: zh_CN: Update Git Glossary: "dumb", "smart"
"dumb/smart HTTP protocol" are normally considered as phrases.
Add "protocol" as a suffix after them makes more sense.

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-23 15:12:22 +08:00
Ray Chen ee7589bb22 l10n: zh_CN: Update Git Glossary: SHA-1
It's quite common to see the term "SHA-1" remain untranslated in many
l10n works. So update the "SHA-1" entry in Git glossary to match this
behavior.

Signed-off-by: Ray Chen <oldsharp@gmail.com>
2015-08-23 15:11:57 +08:00
SZEDER Gábor 7aa9b9ba02 wt-status: move #include "pathspec.h" to the header
The declaration of 'struct wt_status' requires the declararion of 'struct
pathspec'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-21 14:49:27 -07:00
Christian Couder dc5d553b55 trailer: ignore first line of message
When looking for the start of the trailers in the message
we are passed, we should ignore the first line of the message.

The reason is that if we are passed a patch or commit message
then the first line should be the patch title.
If we are passed only trailers we can expect that they start
with an empty line that can be ignored too.

This way we can properly process commit messages that have
only one line with something that looks like a trailer, for
example like "area of code: change we made".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-21 10:17:47 -07:00
Andreas Schwab f04c6904dc Documentation/config: fix inconsistent label on gc.*.reflogExpireUnreachable
Change <ref> to <pattern> in the description of
gc.*.reflogExpireUnreachable, since that is what the text refers to.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-21 10:15:13 -07:00