Commit graph

40658 commits

Author SHA1 Message Date
Junio C Hamano b21089db6a Merge branch 'db/push-sign-if-asked'
The client side codepaths in "git push" have been cleaned up
and the user can request to perform an optional "signed push",
i.e. sign only when the other end accepts signed push.

* db/push-sign-if-asked:
  push: add a config option push.gpgSign for default signed pushes
  push: support signing pushes iff the server supports it
  builtin/send-pack.c: use parse_options API
  config.c: rename git_config_maybe_bool_text and export it as git_parse_maybe_bool
  transport: remove git_transport_options.push_cert
  gitremote-helpers.txt: document pushcert option
  Documentation/git-send-pack.txt: document --signed
  Documentation/git-send-pack.txt: wrap long synopsis line
  Documentation/git-push.txt: document when --signed may fail
2015-08-31 15:39:08 -07:00
Junio C Hamano 5b6211aee1 Merge branch 'jk/notes-merge-config'
"git notes merge" can be told with "--strategy=<how>" option how to
automatically handle conflicts; this can now be configured by
setting notes.mergeStrategy configuration variable.

* jk/notes-merge-config:
  notes: teach git-notes about notes.<name>.mergeStrategy option
  notes: add notes.mergeStrategy option to select default strategy
  notes: add tests for --commit/--abort/--strategy exclusivity
  notes: extract parse_notes_merge_strategy to notes-utils
  notes: extract enum notes_merge_strategy to notes-utils.h
  notes: document cat_sort_uniq rewriteMode
2015-08-31 15:39:05 -07:00
Junio C Hamano d75bb73bcf Merge branch 'jc/am-state-fix'
Recent reimplementation of "git am" changed the format of state
files kept in $GIT_DIR/rebase-apply/ without meaning to do so,
primarily because write_file() API was cumbersome to use and it was
easy to mistakenly make text files with incomplete lines.  Update
write_file() interface to make it harder to misuse.

* jc/am-state-fix:
  write_file(): drop caller-supplied LF from calls to create a one-liner file
  write_file_v(): do not leave incomplete line at the end
  write_file(): drop "fatal" parameter
  builtin/am: make sure state files are text
  builtin/am: introduce write_state_*() helper functions
2015-08-31 15:39:03 -07:00
Junio C Hamano 2ba6183b0b Merge branch 'jc/log-p-cc'
"git log --cc" did not show any patch, even though most of the time
the user meant "git log --cc -p -m" to see patch output for commits
with a single parent, and combined diff for merge commits.  The
command is taught to DWIM "--cc" (without "--raw" and other forms
of output specification) to "--cc -p -m".

* jc/log-p-cc:
  builtin/log.c: minor reformat
  log: show merge commit when --cc is given
  log: when --cc is given, default to -p unless told otherwise
  log: rename "tweak" helpers
2015-08-31 15:38:59 -07:00
Junio C Hamano 7b7c10bf5e Merge branch 'jk/fix-alias-pager-config-key-warnings'
Because the configuration system does not allow "alias.0foo" and
"pager.0foo" as the configuration key, the user cannot use '0foo'
as a custom command name anyway, but "git 0foo" tried to look these
keys up and emitted useless warnings before saying '0foo is not a
git command'.  These warning messages have been squelched.

* jk/fix-alias-pager-config-key-warnings:
  config: silence warnings for command names with invalid keys
2015-08-31 15:38:57 -07:00
Junio C Hamano 0bb71fb36d Merge branch 'jk/rev-list-has-no-notes'
"git rev-list" does not take "--notes" option, but did not complain
when one is given.

* jk/rev-list-has-no-notes:
  rev-list: make it obvious that we do not support notes
2015-08-31 15:38:55 -07:00
Junio C Hamano 5a4f07b322 Merge branch 'hv/submodule-config'
The gitmodules API accessed from the C code learned to cache stuff
lazily.

* hv/submodule-config:
  submodule: allow erroneous values for the fetchRecurseSubmodules option
  submodule: use new config API for worktree configurations
  submodule: extract functions for config set and lookup
  submodule: implement a config API for lookup of .gitmodules values
2015-08-31 15:38:52 -07:00
Junio C Hamano fc9dfda1be Merge branch 'sg/config-name-only'
"git config --list" output was hard to parse when values consist of
multiple lines.  "--name-only" option is added to help this.

* sg/config-name-only:
  get_urlmatch: avoid useless strbuf write
  format_config: simplify buffer handling
  format_config: don't init strbuf
  config: restructure format_config() for better control flow
  completion: list variable names reliably with 'git config --name-only'
  config: add '--name-only' option to list only variable names
2015-08-31 15:38:50 -07:00
Junio C Hamano aecce6d0ef Sync with 2.5.1 2015-08-28 12:32:45 -07:00
Junio C Hamano e6837c8b43 Seventh batch for 2.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 12:32:25 -07:00
Junio C Hamano 483c9b8602 Merge branch 'cc/trailers-corner-case-fix'
"interpret-trailers" helper mistook a single-liner log message that
has a colon as the end of existing trailer.

* cc/trailers-corner-case-fix:
  trailer: retitle a test and correct an in-comment message
  trailer: ignore first line of message
2015-08-28 12:32:17 -07:00
Junio C Hamano 038226ebc6 Merge branch 'dt/untracked-subdir'
The experimental untracked-cache feature were buggy when paths with
a few levels of subdirectories are involved.

* dt/untracked-subdir:
  untracked cache: fix entry invalidation
  untracked-cache: fix subdirectory handling
2015-08-28 12:32:15 -07:00
Junio C Hamano c415fb791b Git 2.5.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 11:19:57 -07:00
Jose F. Morales c3cb7b6fec Mingw: verify both ends of the pipe () call
The code to open and test the second end of the pipe clearly imitates
the code for the first end. A little too closely, though... Let's fix
the obvious copy-edit bug.

Signed-off-by: Jose F. Morales <jfmcjf@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 11:11:50 -07:00
Junio C Hamano 3a9835bf65 Sixth batch for 2.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-26 15:47:48 -07:00
Junio C Hamano 678c5a49ee Merge branch 'sg/help-group'
We rewrote one of the build scripts in Perl but this reimplements
in Bourne shell.

* sg/help-group:
  generate-cmdlist: re-implement as shell script
2015-08-26 15:45:40 -07:00
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
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
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