Commit graph

44421 commits

Author SHA1 Message Date
Junio C Hamano 4af9a7d344 Merge branch 'bc/object-id'
The "unsigned char sha1[20]" to "struct object_id" conversion
continues.  Notable changes in this round includes that ce->sha1,
i.e. the object name recorded in the cache_entry, turns into an
object_id.

It had merge conflicts with a few topics in flight (Christian's
"apply.c split", Dscho's "cat-file --filters" and Jeff Hostetler's
"status --porcelain-v2").  Extra sets of eyes double-checking for
mismerges are highly appreciated.

* bc/object-id:
  builtin/reset: convert to use struct object_id
  builtin/commit-tree: convert to struct object_id
  builtin/am: convert to struct object_id
  refs: add an update_ref_oid function.
  sha1_name: convert get_sha1_mb to struct object_id
  builtin/update-index: convert file to struct object_id
  notes: convert init_notes to use struct object_id
  builtin/rm: convert to use struct object_id
  builtin/blame: convert file to use struct object_id
  Convert read_mmblob to take struct object_id.
  notes-merge: convert struct notes_merge_pair to struct object_id
  builtin/checkout: convert some static functions to struct object_id
  streaming: make stream_blob_to_fd take struct object_id
  builtin: convert textconv_object to use struct object_id
  builtin/cat-file: convert some static functions to struct object_id
  builtin/cat-file: convert struct expand_data to use struct object_id
  builtin/log: convert some static functions to use struct object_id
  builtin/blame: convert struct origin to use struct object_id
  builtin/apply: convert static functions to struct object_id
  cache: convert struct cache_entry to use struct object_id
2016-09-19 13:47:19 -07:00
Junio C Hamano 4322f3848a Merge branch 'mh/ref-store'
The ref-store abstraction was introduced to the refs API so that we
can plug in different backends to store references.

* mh/ref-store: (38 commits)
  refs: implement iteration over only per-worktree refs
  refs: make lock generic
  refs: add method to rename refs
  refs: add methods to init refs db
  refs: make delete_refs() virtual
  refs: add method for initial ref transaction commit
  refs: add methods for reflog
  refs: add method iterator_begin
  files_ref_iterator_begin(): take a ref_store argument
  split_symref_update(): add a files_ref_store argument
  lock_ref_sha1_basic(): add a files_ref_store argument
  lock_ref_for_update(): add a files_ref_store argument
  commit_ref_update(): add a files_ref_store argument
  lock_raw_ref(): add a files_ref_store argument
  repack_without_refs(): add a files_ref_store argument
  refs: make peel_ref() virtual
  refs: make create_symref() virtual
  refs: make pack_refs() virtual
  refs: make verify_refname_available() virtual
  refs: make read_raw_ref() virtual
  ...
2016-09-19 13:47:19 -07:00
Junio C Hamano 81358dc238 Merge branch 'cc/apply-am'
"git am" has been taught to make an internal call to "git apply"'s
innards without spawning the latter as a separate process.

* cc/apply-am: (41 commits)
  builtin/am: use apply API in run_apply()
  apply: learn to use a different index file
  apply: pass apply state to build_fake_ancestor()
  apply: refactor `git apply` option parsing
  apply: change error_routine when silent
  usage: add get_error_routine() and get_warn_routine()
  usage: add set_warn_routine()
  apply: don't print on stdout in verbosity_silent mode
  apply: make it possible to silently apply
  apply: use error_errno() where possible
  apply: make some parsing functions static again
  apply: move libified code from builtin/apply.c to apply.{c,h}
  apply: rename and move opt constants to apply.h
  builtin/apply: rename option parsing functions
  builtin/apply: make create_one_file() return -1 on error
  builtin/apply: make try_create_file() return -1 on error
  builtin/apply: make write_out_results() return -1 on error
  builtin/apply: make write_out_one_result() return -1 on error
  builtin/apply: make create_file() return -1 on error
  builtin/apply: make add_index_file() return -1 on error
  ...
2016-09-19 13:47:18 -07:00
Junio C Hamano e510a86c81 Second batch for 2.11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-15 14:13:06 -07:00
Junio C Hamano e6a51afba4 Merge branch 'js/git-gui-commit-gpgsign'
"git commit-tree" stopped reading commit.gpgsign configuration
variable that was meant for Porcelain "git commit" in Git 2.9; we
forgot to update "git gui" to look at the configuration to match
this change.

* js/git-gui-commit-gpgsign:
  git-gui: respect commit.gpgsign again
2016-09-15 14:11:16 -07:00
Junio C Hamano 2a4062a4a8 Merge branch 'js/sequencer-wo-die'
Lifts calls to exit(2) and die() higher in the callchain in
sequencer.c files so that more helper functions in it can be used
by callers that want to handle error conditions themselves.

* js/sequencer-wo-die:
  sequencer: ensure to release the lock when we could not read the index
  sequencer: lib'ify checkout_fast_forward()
  sequencer: lib'ify fast_forward_to()
  sequencer: lib'ify save_opts()
  sequencer: lib'ify save_todo()
  sequencer: lib'ify save_head()
  sequencer: lib'ify create_seq_dir()
  sequencer: lib'ify read_populate_opts()
  sequencer: lib'ify read_populate_todo()
  sequencer: lib'ify read_and_refresh_cache()
  sequencer: lib'ify prepare_revs()
  sequencer: lib'ify walk_revs_populate_todo()
  sequencer: lib'ify do_pick_commit()
  sequencer: lib'ify do_recursive_merge()
  sequencer: lib'ify write_message()
  sequencer: do not die() in do_pick_commit()
  sequencer: lib'ify sequencer_pick_revisions()
2016-09-15 14:11:16 -07:00
Junio C Hamano a0d9b7f015 Merge branch 'sb/diff-cleanup'
Code cleanup.

* sb/diff-cleanup:
  diff: remove dead code
  diff: omit found pointer from emit_callback
  diff.c: use diff_options directly
2016-09-15 14:11:16 -07:00
Junio C Hamano c13f458d86 Merge branch 'jk/fix-remote-curl-url-wo-proto'
"git fetch http::/site/path" did not die correctly and segfaulted
instead.

* jk/fix-remote-curl-url-wo-proto:
  remote-curl: handle URLs without protocol
2016-09-15 14:11:15 -07:00
Junio C Hamano 4fa1251bc2 Merge branch 'ah/misc-message-fixes'
Message cleanup.

* ah/misc-message-fixes:
  unpack-trees: do not capitalize "working"
  git-merge-octopus: do not capitalize "octopus"
  git-rebase--interactive: fix English grammar
  cat-file: put spaces around pipes in usage string
  am: put spaces around pipe in usage string
2016-09-15 14:11:15 -07:00
Junio C Hamano 581c08e802 Merge branch 'sy/git-gui-i18n-ja'
Update Japanese translation for "git-gui".

* sy/git-gui-i18n-ja:
  git-gui: update Japanese information
  git-gui: update Japanese translation
  git-gui: add Japanese language code
  git-gui: apply po template to Japanese translation
  git-gui: consistently use the same word for "blame" in Japanese
  git-gui: consistently use the same word for "remote" in Japanese
2016-09-15 14:11:14 -07:00
Junio C Hamano 9883ec2c73 Merge branch 'jk/pack-tag-of-tag'
"git pack-objects --include-tag" was taught that when we know that
we are sending an object C, we want a tag B that directly points at
C but also a tag A that points at the tag B.  We used to miss the
intermediate tag B in some cases.

* jk/pack-tag-of-tag:
  pack-objects: walk tag chains for --include-tag
  t5305: simplify packname handling
  t5305: use "git -C"
  t5305: drop "dry-run" of unpack-objects
  t5305: move cleanup into test block
2016-09-15 14:11:14 -07:00
Junio C Hamano 35f6318d44 Sync with maint
* maint:
  l10n: zh_CN: review for git v2.10.0 l10n
  l10n: zh_CN: fixed some typos for git 2.10.0
  l10n: pt_PT: update Portuguese repository info
  l10n: pt_PT: update Portuguese translation
2016-09-12 15:35:14 -07:00
Junio C Hamano 75d03ac84b First batch for 2.11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-12 15:35:05 -07:00
Junio C Hamano bbc143e096 Merge branch 'sb/transport-report-missing-submodule-on-stderr'
Message cleanup.

* sb/transport-report-missing-submodule-on-stderr:
  transport: report missing submodule pushes consistently on stderr
2016-09-12 15:34:38 -07:00
Junio C Hamano 930b67ebd7 Merge branch 'ep/use-git-trace-curl-in-tests'
Update a few tests that used to use GIT_CURL_VERBOSE to use the
newer GIT_TRACE_CURL.

* ep/use-git-trace-curl-in-tests:
  t5551-http-fetch-smart.sh: use the GIT_TRACE_CURL environment var
  t5550-http-fetch-dumb.sh: use the GIT_TRACE_CURL environment var
  test-lib.sh: preserve GIT_TRACE_CURL from the environment
  t5541-http-push-smart.sh: use the GIT_TRACE_CURL environment var
2016-09-12 15:34:38 -07:00
Junio C Hamano b2735955f5 Merge branch 'sb/xdiff-remove-unused-static-decl'
Code cleanup.

* sb/xdiff-remove-unused-static-decl:
  xdiff: remove unneeded declarations
2016-09-12 15:34:38 -07:00
Junio C Hamano ba06991e5f Merge branch 'js/t6026-clean-up'
A test spawned a short-lived background process, which sometimes
prevented the test directory from getting removed at the end of the
script on some platforms.

* js/t6026-clean-up:
  t6026-merge-attr: clean up background process at end of test case
2016-09-12 15:34:37 -07:00
Junio C Hamano 038763c71a Merge branch 'js/t9903-chaining'
* js/t9903-chaining:
  t9903: fix broken && chain
2016-09-12 15:34:37 -07:00
Junio C Hamano e4ec05ed93 Merge branch 'rs/hex2chr'
* rs/hex2chr:
  introduce hex2chr() for converting two hexadecimal digits to a character
2016-09-12 15:34:36 -07:00
Junio C Hamano 27853a85ed Merge branch 'rs/compat-strdup'
* rs/compat-strdup:
  compat: move strdup(3) replacement to its own file
2016-09-12 15:34:36 -07:00
Junio C Hamano d1de693d0d Merge branch 'jc/forbid-symbolic-ref-d-HEAD'
"git symbolic-ref -d HEAD" happily removes the symbolic ref, but
the resulting repository becomes an invalid one.  Teach the command
to forbid removal of HEAD.

* jc/forbid-symbolic-ref-d-HEAD:
  symbolic-ref -d: do not allow removal of HEAD
2016-09-12 15:34:35 -07:00
Junio C Hamano 293c232ab1 Merge branch 'jc/submodule-anchor-git-dir'
Having a submodule whose ".git" repository is somehow corrupt
caused a few commands that recurse into submodules loop forever.

* jc/submodule-anchor-git-dir:
  submodule: avoid auto-discovery in prepare_submodule_repo_env()
2016-09-12 15:34:34 -07:00
Junio C Hamano 368332c471 Merge branch 'jk/squelch-false-warning-from-gcc-o3'
* jk/squelch-false-warning-from-gcc-o3:
  color_parse_mem: initialize "struct color" temporary
  error_errno: use constant return similar to error()
2016-09-12 15:34:33 -07:00
Junio C Hamano 8f6fd086e6 Merge branch 'jk/test-lib-drop-pid-from-results'
The test framework left the number of tests and success/failure
count in the t/test-results directory, keyed by the name of the
test script plus the process ID.  The latter however turned out not
to serve any useful purpose.  The process ID part of the filename
has been removed.

* jk/test-lib-drop-pid-from-results:
  test-lib: drop PID from test-results/*.count
2016-09-12 15:34:33 -07:00
Junio C Hamano 87f5de387c Merge branch 'jc/am-read-author-file'
Extract a small helper out of the function that reads the authors
script file "git am" internally uses.

* jc/am-read-author-file:
  am: refactor read_author_script()
2016-09-12 15:34:32 -07:00
Junio C Hamano 305d7f1339 Merge branch 'jk/diff-submodule-diff-inline'
The "git diff --submodule={short,log}" mechanism has been enhanced
to allow "--submodule=diff" to show the patch between the submodule
commits bound to the superproject.

* jk/diff-submodule-diff-inline:
  diff: teach diff to display submodule difference with an inline diff
  submodule: refactor show_submodule_summary with helper function
  submodule: convert show_submodule_summary to use struct object_id *
  allow do_submodule_path to work even if submodule isn't checked out
  diff: prepare for additional submodule formats
  graph: add support for --line-prefix on all graph-aware output
  diff.c: remove output_prefix_length field
  cache: add empty_tree_oid object and helper function
2016-09-12 15:34:31 -07:00
Junio C Hamano 91942260a2 l10n-2.10.0-rnd2.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX1WH0AAoJEMek6Rt1RHooINYP/jcQyV6e06KGcr8hOhOFfxiV
 HYTuaXiMAz/SNB9fu7JGccB0iXfUWWvGS+rVtNWtwn8GFh5MI4jc9qnpNjg7yYSV
 rINCrIEvaTzXt9cBDTKCsxQ4UTno6D7p22bUJNGmyEcyKzowJPWlCYsvSTn2wP4j
 dq2FzAGcvSRteI5wEzp3ZfMWEfSZ12zSWH/SSCMfyp/JgSwNCkxiWzF9uT5aQPUU
 cvc+V0GIkdq/StRuZFPDXHniMBAYPRFfjKpe90skPEwbmudYpJ+x3/O7APqg3lqo
 sM+9IQnqKli1fQeZqF8mAGj8Xi46Ts8l1O9oJJrCtbzmrTSsfVmEi/WmDYzm60S/
 Qcuyd2v8K3zXkxslvgReO7yd7cTeNHLznXhHm1EPPyVf1YVYJM6nbOqmnFNhhs46
 jUIZDVdy2CFsDhj9JljYotxMka4grHLZpyOrijREjKhBHXWuzum54FjPNuNFS7Og
 IjHPwtrtuqI9/NyTYXO3AQQYRLuV5CEDd/HvlYR9S5OlRM3oezdZNfyGive8BdAt
 SCjYiYSlNaLgEvibtmjAnKVFCdt2KMCxtahxPw+hF085Ose+61DZ1dq8R/Wkbc5V
 nrWxMzTdPd0i6AhA7mwXE06KBtEdhOxGc3LvLoDMOy0Qcbp2Pw6ybLI4pwyWvKG/
 0n90tvdNfoSGorklJww1
 =54IT
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.10.0-rnd2.3' of git://github.com/git-l10n/git-po into maint

l10n-2.10.0-rnd2.3

* tag 'l10n-2.10.0-rnd2.3' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: review for git v2.10.0 l10n
  l10n: zh_CN: fixed some typos for git 2.10.0
  l10n: pt_PT: update Portuguese repository info
  l10n: pt_PT: update Portuguese translation
2016-09-12 15:23:42 -07:00
Junio C Hamano f14a310e8b Merge branch 'js/commit-gpgsign' of ../git-gui into js/git-gui-commit-gpgsign
* 'js/commit-gpgsign' of ../git-gui:
  git-gui: respect commit.gpgsign again
2016-09-11 14:54:46 -07:00
Johannes Schindelin 2afe6b733e git-gui: respect commit.gpgsign again
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing with GPG signature in Git GUI.

This fixes https://github.com/git-for-windows/git/issues/850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-11 14:52:27 -07:00
Ray Chen 9a4b694c53 l10n: zh_CN: review for git v2.10.0 l10n
Signed-off-by: Ray Chen <oldsharp@gmail.com>
2016-09-11 21:34:23 +08:00
Jiang Xin 7665d45926 l10n: zh_CN: fixed some typos for git 2.10.0
Reviewed-by: Ray <tvvocold@163.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-09-11 21:31:51 +08:00
David Turner 0c09ec07d1 refs: implement iteration over only per-worktree refs
Alternate refs backends might still use files to store per-worktree
refs. So provide a way to iterate over only the per-worktree references
in a ref_store. The other backend can set up a files ref_store and
iterate using the new DO_FOR_EACH_PER_WORKTREE_ONLY flag when iterating.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner 7d61826439 refs: make lock generic
Instead of including a files-backend-specific struct ref_lock, change
the generic ref_update struct to include a void pointer that backends
can use for their own arbitrary data.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner 9b6b40d93a refs: add method to rename refs
This removes the last caller of function get_files_ref_store(), so
remove it.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner 6fb5acfd8f refs: add methods to init refs db
Alternate refs backends might not need the refs/heads directory and so
on, so we make ref db initialization part of the backend.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner a27dcf89b6 refs: make delete_refs() virtual
In the file-based backend, delete_refs has some special optimization
to deal with packed refs.  In other backends, we might be able to make
ref deletion faster by putting all deletions into a single
transaction.  So we need a special backend function for this.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner fc6814637d refs: add method for initial ref transaction commit
Signed-off-by: Ronnie Sahlberg <rsahlberg@google.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:14 -07:00
David Turner e3688bd6cf refs: add methods for reflog
In the file-based backend, the reflog piggybacks on the ref lock.
Since other backends won't have the same sort of ref lock, ref backends
must also handle reflogs.

Signed-off-by: Ronnie Sahlberg <rsahlberg@google.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 1a769003c1 refs: add method iterator_begin
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 37b6f6d5f4 files_ref_iterator_begin(): take a ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty fcc42ea0c9 split_symref_update(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 7eb27cdfe6 lock_ref_sha1_basic(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty b3bbbc5c24 lock_ref_for_update(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty f18a789250 commit_ref_update(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty f7b0a987b5 lock_raw_ref(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 0a95ac5f63 repack_without_refs(): add a files_ref_store argument
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty bd427cf27f refs: make peel_ref() virtual
For now it only supports the main reference store.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 284689ba0f refs: make create_symref() virtual
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 8231527e15 refs: make pack_refs() virtual
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00
Michael Haggerty 62665823d2 refs: make verify_refname_available() virtual
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-09 15:28:13 -07:00