Commit graph

41376 commits

Author SHA1 Message Date
brian m. carlson 7999b2cf77 Add several uses of get_object_hash.
Convert most instances where the sha1 member of struct object is
dereferenced to use get_object_hash.  Most instances that are passed to
functions that have versions taking struct object_id, such as
get_sha1_hex/get_oid_hex, or instances that can be trivially converted
to use struct object_id instead, are not converted.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson 3c4270107f object: introduce get_object_hash macro.
This macro is a temporary change to ease the transition of struct object
to use struct object_id.  It takes an argument of struct object and
returns the object's hash.  Provide this hash next to struct object for
easier conversion.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson 6f3d57b6e4 ref_newer: convert to use struct object_id
Convert ref_newer and its caller to use struct object_id instead of
unsigned char *.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson 27912a03fd push_refs_with_export: convert to struct object_id
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson e96b16cc2a get_remote_heads: convert to struct object_id
Replace an unsigned char array with struct object_id and express several
hard-coded constants in terms of GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson 8338c911d1 parse_fetch: convert to use struct object_id
Convert the parse_fetch function to use struct object_id.  Remove the
strlen check as get_oid_hex will fail safely on receiving a too-short
NUL-terminated string.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson 854ecb9cad add_sought_entry_mem: convert to struct object_id
Convert this function to use struct object_id.  Express several
hardcoded constants in terms of GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson f4e54d02b8 Convert struct ref to use object_id.
Use struct object_id in three fields in struct ref and convert all the
necessary places that use it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
brian m. carlson b419aa25d5 sha1_file: introduce has_object_file helper.
Add has_object_file, which is a wrapper around has_sha1_file, but for
struct object_id.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-20 08:02:05 -05:00
Jeff King 0c83680e9c Merge branch 'master' of git://git.bogomips.org/git-svn
* 'master' of git://git.bogomips.org/git-svn:
  git-svn: improve rebase/mkdirs performance
2015-11-20 06:56:58 -05:00
Jeff King dbba85e46b Merge branch 'lf/ref-is-hidden-namespace'
Extend transfer.hideRefs to work better with use of namespaces.

* lf/ref-is-hidden-namespace:
  t5509: add basic tests for hideRefs
  hideRefs: add support for matching full refs
  upload-pack: strip refs before calling ref_is_hidden()
  config.txt: document the semantics of hideRefs with namespaces
2015-11-20 06:56:11 -05:00
Jeff King 45014beac0 Merge branch 'dk/gc-idx-wo-pack'
Having a leftover .idx file without corresponding .pack file in
the repository hurts performance; "git gc" learned to prune them.

* dk/gc-idx-wo-pack:
  gc: remove garbage .idx files from pack dir
  t5304: test cleaning pack garbage
  prepare_packed_git(): refactor garbage reporting in pack directory
2015-11-20 06:55:34 -05:00
Dair Grant 8262574822 git-svn: improve rebase/mkdirs performance
Processing empty_dir directives becomes extremely slow for svn
repositories with a large enough history.

This is due to using a single hash to store the list of empty
directories, with the expensive step being purging items from
that hash using grep+delete.

Storing directories in a hash of hashes improves the performance
of this purge step and removes a potentially lengthy delay after
every rebase/mkdirs command.

The svn repository with this behaviour has 110K commits with
unhandled.log containing 170K empty_dir directives.

This takes 10 minutes to process when using a single hash, vs
3 seconds with a hash of hashes.

Signed-off-by: Dair Grant <dair@feralinteractive.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2015-11-10 01:35:01 +00:00
Junio C Hamano f34be46e47 Eleventh batch for 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 15:26:08 -08:00
Junio C Hamano 6a38bd6268 Merge branch 'ea/checkout-progress'
"git checkout" did not follow the usual "--[no-]progress"
convention and implemented only "--quiet" that is essentially
a superset of "--no-progress".  Extend the command to support the
usual "--[no-]progress".

* ea/checkout-progress:
  checkout: add --progress option
2015-11-05 15:24:28 -08:00
Junio C Hamano 848cdba579 Merge branch 'dt/http-range'
A Range: request can be responded with a full response and when
asked properly libcurl knows how to strip the result down to the
requested range.  However, we were hand-crafting a range request
and it did not kick in.

* dt/http-range:
  http: use off_t to store partial file size
  http.c: use CURLOPT_RANGE for range requests
2015-11-05 15:24:27 -08:00
Junio C Hamano 2c78628255 Git 2.6.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWO7oaAAoJELC16IaWr+bLwiQQANoJ1mtinMYQjqq4oNTKTNw1
 YTPCg1CF+QglubvywBSWxujhpdou/Ibup6DSKnGQKiueRbCZZXkxWSgGaTY5mpi1
 N9Y6NaQDlTwdZIF6LYv+5PrKFw2Ad2n3Pcj8EELsw7FnC5EiiBwmagJPzuwsyznK
 07pJ5kySJW3Zq06jiv1xKKiqKhMyYiLtlqFsrevAnOm5WFG2eNPLMneBrcXE4/yV
 u4DCAuXtfjiXq3zLMdjXNgRia64SQ+TukIbBox7hAh+TFaPiE9ZB+dM4dlSJM8DP
 lHQT/WjMJx0AgkUdFsF7HZ/K3I3yoXGR4oe/2QH+Tu6UXCeb+ol1Xm0JhqX7xDXN
 /59DPdGEgZQe5OJ2swh4kqIYlkKLKE6QW+n2ZhUAZzAG08br8h0IE3afap90Lh1M
 E4qS2NpT28ig++FXcfvYUNYHrZzVp/bEsMZjQv9zX76FCsBgjr7FDptm+VyBgL/+
 8PXOcBsBBTdf+hUDO84XV1IWkXi2icOgSRBmY76AYHnCxMguiPnzaKhIG4MnGyyp
 VwkBWm/gjg3dNuO2XhyELdlxw+jO4B6ULrku3oN1NmIpkbEIc4dyVwWRF4dvNq8F
 eFZLbXSAWPDBIB9fLuSbg7YW2f/NFigycQEISzsJrlhXqCTTzkVeBqgJFp9+wFJw
 4Ue+XxrFgz7dW15B4Ggi
 =ohVR
 -----END PGP SIGNATURE-----

Sync with 2.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 12:22:34 -08:00
Junio C Hamano af40944bda Git 2.6.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 12:20:34 -08:00
Junio C Hamano b8f5242592 Merge branch 'rs/daemon-plug-child-leak' into maint
"git daemon" uses "run_command()" without "finish_command()", so it
needs to release resources itself, which it forgot to do.

* rs/daemon-plug-child-leak:
  daemon: plug memory leak
  run-command: factor out child_process_clear()
2015-11-05 12:18:17 -08:00
Junio C Hamano db43891ce6 Merge branch 'rs/wt-status-detached-branch-fix' into maint
"git status --branch --short" accessed beyond the constant string
"HEAD", which has been corrected.

* rs/wt-status-detached-branch-fix:
  wt-status: use skip_prefix() to get rid of magic string length constants
  wt-status: don't skip a magical number of characters blindly
  wt-status: avoid building bogus branch name with detached HEAD
  wt-status: exit early using goto in wt_shortstatus_print_tracking()
  t7060: add test for status --branch on a detached HEAD
2015-11-05 12:18:15 -08:00
Junio C Hamano f97aee1f94 Merge branch 'jk/initialization-fix-to-add-submodule-odb' into maint
We peek objects from submodule's object store by linking it to the
list of alternate object databases, but the code to do so forgot to
correctly initialize the list.

* jk/initialization-fix-to-add-submodule-odb:
  add_submodule_odb: initialize alt_odb list earlier
2015-11-05 12:18:14 -08:00
Junio C Hamano ace5348dcb Merge branch 'js/misc-fixes' into maint
Various compilation fixes and squelching of warnings.

* js/misc-fixes:
  Correct fscanf formatting string for I64u values
  Silence GCC's "cast of pointer to integer of a different size" warning
  Squelch warning about an integer overflow
2015-11-05 12:18:13 -08:00
Junio C Hamano a878e7e62b Merge branch 'jc/add-u-A-default-to-top' into maint
"git --literal-pathspecs add -u/-A" without any command line
argument misbehaved ever since Git 2.0.

* jc/add-u-A-default-to-top:
  add: simplify -u/-A without pathspec
2015-11-05 12:18:12 -08:00
Junio C Hamano 5e6154fb14 Merge branch 'jk/delete-modechange-conflict' into maint
Merging a branch that removes a path and another that changes the
mode bits on the same path should have conflicted at the path, but
it didn't and silently favoured the removal.

* jk/delete-modechange-conflict:
  merge: detect delete/modechange conflict
  t6031: generalize for recursive and resolve strategies
  t6031: move triple-rename test to t3030
2015-11-05 12:18:11 -08:00
Junio C Hamano c378862b1e Merge branch 'js/imap-send-curl-compilation-fix' into maint
"git imap-send" did not compile well with older version of cURL library.

* js/imap-send-curl-compilation-fix:
  imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available
2015-11-05 12:18:10 -08:00
Junio C Hamano 3897d2d906 Merge branch 'rp/link-curl-before-ssl' into maint
The linkage order of libraries was wrong in places around libcurl.

* rp/link-curl-before-ssl:
  configure.ac: detect ssl need with libcurl
  Makefile: make curl-config path configurable
  Makefile: link libcurl before zlib
2015-11-05 12:18:09 -08:00
Junio C Hamano 4349f597f0 Merge branch 'nd/clone-linked-checkout' into maint
It was not possible to use a repository-lookalike created by "git
worktree add" as a local source of "git clone".

* nd/clone-linked-checkout:
  clone: better error when --reference is a linked checkout
  clone: allow --local from a linked checkout
  enter_repo: allow .git files in strict mode
  enter_repo: avoid duplicating logic, use is_git_directory() instead
  t0002: add test for enter_repo(), non-strict mode
  path.c: delete an extra space
2015-11-05 12:18:08 -08:00
Junio C Hamano 53be145209 Merge branch 'sa/send-email-smtp-batch-data-limit' into maint
When "git send-email" wanted to talk over Net::SMTP::SSL,
Net::Cmd::datasend() did not like to be fed too many bytes at the
same time and failed to send messages.  Send the payload one line
at a time to work around the problem.

* sa/send-email-smtp-batch-data-limit:
  git-send-email.perl: Fixed sending of many/huge changes/patches
2015-11-05 12:18:06 -08:00
Lukas Fleischer 948bfa2c0f t5509: add basic tests for hideRefs
Test whether regular and full hideRefs patterns work as expected when
namespaces are used.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 11:25:02 -08:00
Lukas Fleischer 78a766ab6e hideRefs: add support for matching full refs
In addition to matching stripped refs, one can now add hideRefs
patterns that the full (unstripped) ref is matched against. To
distinguish between stripped and full matches, those new patterns
must be prefixed with a circumflex (^).

This commit also removes support for the undocumented and unintended
hideRefs settings ".have" (suppressing all "have" lines) and
"capabilities^{}" (suppressing the capabilities line).

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 11:25:02 -08:00
Lukas Fleischer 00b293e519 upload-pack: strip refs before calling ref_is_hidden()
Make hideRefs handling in upload-pack consistent with the behavior
described in the documentation by stripping refs before comparing them
with prefixes in hideRefs.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 11:25:02 -08:00
Lukas Fleischer 92cab492ba config.txt: document the semantics of hideRefs with namespaces
Right now, there is no clear definition of how transfer.hideRefs should
behave when a namespace is set. Explain that hideRefs prefixes match
stripped names in that case. This is how hideRefs patterns are currently
handled in receive-pack.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-05 11:25:00 -08:00
Junio C Hamano 259b5e6d33 Sync with maint
* maint:
2015-11-04 14:21:41 -08:00
Junio C Hamano 684fea3794 Merge branch 'xf/user-manual-ff' into maint
* xf/user-manual-ff:
  user-manual: fix the description of fast-forward
2015-11-04 14:20:49 -08:00
Junio C Hamano 6c66686e0b Merge branch 'xf/user-manual-markup' into maint
AsciiDoc markup fixes.

* xf/user-manual-markup:
  Documentation: match undefline with the text in old release notes
  Documentation: match underline with the text
  Documentation: fix header markup
2015-11-04 14:20:47 -08:00
Junio C Hamano 7974b3fd75 Merge branch 'jc/everyday-markup' into maint
AsciiDoc markup fixes.

* jc/everyday-markup:
  Documentation/everyday: match undefline with the text
2015-11-04 14:20:46 -08:00
Junio C Hamano bc1e0481bf Merge branch 'jc/em-dash-in-doc' into maint
AsciiDoc markup fixes.

* jc/em-dash-in-doc:
  Documentation: AsciiDoc spells em-dash as double-dashes, not triple
2015-11-04 14:20:45 -08:00
Junio C Hamano d091031ce2 Merge branch 'es/worktree-add' into maint
* es/worktree-add:
  worktree: usage: denote <branch> as optional with 'add'
2015-11-04 14:20:44 -08:00
Doug Kelly 478f34d2b6 gc: remove garbage .idx files from pack dir
Add a custom report_garbage handler to collect and remove
garbage .idx files from the pack directory.

Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-04 11:30:22 -08:00
Doug Kelly e6d65c9a47 t5304: test cleaning pack garbage
Pack garbage, noticeably stale .idx files, can be cleaned up during
a garbage collection.  This tests to ensure such garbage is properly
cleaned up.

Note that the prior test for checking pack garbage with count-objects
left some stale garbage after the test exited.  This has also been
corrected.

Signed-off-by: Doug Kelly <dougk.ff7@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-11-04 11:30:10 -08:00
Junio C Hamano aa826b651a Sync with maint 2015-11-03 15:41:50 -08:00
Junio C Hamano fdca2bed90 Merge branch 'mk/blame-error-message' into maint
The error message from "git blame --contents --reverse" incorrectly
talked about "--contents --children".

* mk/blame-error-message:
  blame: fix option name in error message
2015-11-03 15:32:43 -08:00
Junio C Hamano 5c15ca0b3c Merge branch 'jk/merge-file-exit-code' into maint
"git merge-file" tried to signal how many conflicts it found, which
obviously would not work well when there are too many of them.

* jk/merge-file-exit-code:
  merge-file: clamp exit code to maximum 127
2015-11-03 15:32:41 -08:00
Junio C Hamano 3a27eec48e Merge branch 'dt/name-hash-dir-entry-fix' into maint
The name-hash subsystem that is used to cope with case insensitive
filesystems keeps track of directories and their on-filesystem
cases for all the paths in the index by holding a pointer to a
randomly chosen cache entry that is inside the directory (for its
ce->ce_name component).  This pointer was not updated even when the
cache entry was removed from the index, leading to use after free.
This was fixed by recording the path for each directory instead of
borrowing cache entries and restructuring the API somewhat.

* dt/name-hash-dir-entry-fix:
  name-hash: don't reuse cache_entry in dir_entry
2015-11-03 15:32:40 -08:00
Junio C Hamano ced2321a8d Merge branch 'jc/am-3-fallback-regression-fix' into maint
"git am -3" had a small regression where it is aborted in its error
handling codepath when underlying merge-recursive failed in certain
ways, as it assumed that the internal call to merge-recursive will
never die, which is not the case (yet).

* jc/am-3-fallback-regression-fix:
  am -3: do not let failed merge from completing the error codepath
2015-11-03 15:32:39 -08:00
Junio C Hamano f5f7684596 Merge branch 'jc/usage-stdin' into maint
The synopsis text and the usage string of subcommands that read
list of things from the standard input are often shown as if they
only take input from a file on a filesystem, which was misleading.

* jc/usage-stdin:
  usage: do not insist that standard input must come from a file
2015-11-03 15:32:38 -08:00
Junio C Hamano 14f905caf2 Merge branch 'rt/placeholder-in-usage' into maint
A couple of commands still showed "[options]" in their usage string
to note where options should come on their command line, but we
spell that "[<options>]" in most places these days.

* rt/placeholder-in-usage:
  am, credential-cache: add angle brackets to usage string
2015-11-03 15:32:37 -08:00
Junio C Hamano ccb47391c1 Merge branch 'dt/t7063-fix-flaky-test' into maint
* dt/t7063-fix-flaky-test:
  t7063: fix flaky untracked-cache test
2015-11-03 15:32:36 -08:00
Junio C Hamano 1bf986bc9c Merge branch 'mk/submodule-gitdir-path' into maint
The submodule code has been taught to work better with separate
work trees created via "git worktree add".

* mk/submodule-gitdir-path:
  path: implement common_dir handling in git_pathdup_submodule()
  submodule refactor: use strbuf_git_path_submodule() in add_submodule_odb()
2015-11-03 15:32:35 -08:00
Junio C Hamano c1324e66d4 Merge branch 'nd/gc-auto-background-fix' into maint
When "git gc --auto" is backgrounded, its diagnosis message is
lost.  Save it to a file in $GIT_DIR and show it next time the "gc
--auto" is run.

* nd/gc-auto-background-fix:
  gc: save log from daemonized gc --auto and print it next time
2015-11-03 15:32:33 -08:00