summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-08-23Merge branch 'as/grep-quiet-no-match-exit-code-fix'Libravatar Junio C Hamano2-1/+6
"git grep -L" and "git grep --quiet -L" reported different exit codes; this has been corrected. * as/grep-quiet-no-match-exit-code-fix: git-grep: correct exit code with --quiet and -L
2017-08-23Merge branch 'kw/commit-keep-index-when-pre-commit-is-not-run'Libravatar Junio C Hamano1-6/+9
"git commit" used to discard the index and re-read from the filesystem just in case the pre-commit hook has updated it in the middle; this has been optimized out when we know we do not run the pre-commit hook. * kw/commit-keep-index-when-pre-commit-is-not-run: commit: skip discarding the index if there is no pre-commit hook
2017-08-23Merge branch 'sb/sha1-file-cleanup'Libravatar Junio C Hamano2-2/+2
Code clean-up. * sb/sha1-file-cleanup: sha1_file: make read_info_alternates static
2017-08-23Merge branch 'rs/t1002-do-not-use-sum'Libravatar Junio C Hamano2-35/+35
Test simplification. * rs/t1002-do-not-use-sum: t1002: stop using sum(1)
2017-08-23Merge branch 'kd/stash-with-bash-4.4'Libravatar Junio C Hamano1-2/+9
bash 4.4 or newer gave a warning on NUL byte in command substitution done in "git stash"; this has been squelched. * kd/stash-with-bash-4.4: stash: prevent warning about null bytes in input
2017-08-23Merge branch 'ah/doc-empty-string-is-false'Libravatar Junio C Hamano2-6/+7
Doc update. * ah/doc-empty-string-is-false: doc: clarify "config --bool" behaviour with empty string
2017-08-23Merge branch 'kw/rebase-progress'Libravatar Junio C Hamano4-0/+21
"git rebase", especially when it is run by mistake and ends up trying to replay many changes, spent long time in silence. The command has been taught to show progress report when it spends long time preparing these many changes to replay (which would give the user a chance to abort with ^C). * kw/rebase-progress: rebase: turn on progress option by default for format-patch format-patch: have progress option while generating patches
2017-08-23Merge branch 'ks/prepare-commit-msg-sample-fix'Libravatar Junio C Hamano1-1/+1
An "oops" fix to a topic that is already in 'master'. * ks/prepare-commit-msg-sample-fix: hook: use correct logical variable
2017-08-23Merge branch 'nm/stash-untracked'Libravatar Junio C Hamano2-5/+23
"git stash -u" used the contents of the committed version of the ".gitignore" file to decide which paths are ignored, even when the file has local changes. The command has been taught to instead use the locally modified contents. * nm/stash-untracked: stash: clean untracked files before reset
2017-08-23Merge branch 'jt/sha1-file-cleanup'Libravatar Junio C Hamano1-32/+7
Preparatory code clean-up. * jt/sha1-file-cleanup: sha1_file: remove read_packed_sha1() sha1_file: set whence in storage-specific info fn
2017-08-22The second batch post 2.14Libravatar Junio C Hamano1-0/+57
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-22Merge branch 'mh/packed-ref-store'Libravatar Junio C Hamano8-564/+1098
The "ref-store" code reorganization continues. * mh/packed-ref-store: (32 commits) files-backend: cheapen refname_available check when locking refs packed_ref_store: handle a packed-refs file that is a symlink read_packed_refs(): die if `packed-refs` contains bogus data t3210: add some tests of bogus packed-refs file contents repack_without_refs(): don't lock or unlock the packed refs commit_packed_refs(): remove call to `packed_refs_unlock()` clear_packed_ref_cache(): don't protest if the lock is held packed_refs_unlock(), packed_refs_is_locked(): new functions packed_refs_lock(): report errors via a `struct strbuf *err` packed_refs_lock(): function renamed from lock_packed_refs() commit_packed_refs(): use a staging file separate from the lockfile commit_packed_refs(): report errors rather than dying packed_ref_store: make class into a subclass of `ref_store` packed-backend: new module for handling packed references packed_read_raw_ref(): new function, replacing `resolve_packed_ref()` packed_ref_store: support iteration packed_peel_ref(): new function, extracted from `files_peel_ref()` repack_without_refs(): take a `packed_ref_store *` parameter get_packed_ref(): take a `packed_ref_store *` parameter rollback_packed_refs(): take a `packed_ref_store *` parameter ...
2017-08-22Merge branch 'sb/retire-t1200'Libravatar Junio C Hamano1-268/+0
A test script that outlived its usefulness has been removed. * sb/retire-t1200: t1200: remove t1200-tutorial.sh
2017-08-22Merge branch 'rs/win32-syslog-leakfix'Libravatar Junio C Hamano1-0/+2
Memory leak in an error codepath has been plugged. * rs/win32-syslog-leakfix: win32: plug memory leak on realloc() failure in syslog()
2017-08-22Merge branch 'rs/unpack-entry-leakfix'Libravatar Junio C Hamano1-2/+3
Memory leak in an error codepath has been plugged. * rs/unpack-entry-leakfix: sha1_file: release delta_stack on error in unpack_entry()
2017-08-22Merge branch 'rs/strbuf-getwholeline-fix'Libravatar Junio C Hamano1-0/+1
A helper function to read a single whole line into strbuf mistakenly triggered OOM error at EOF under certain conditions, which has been fixed. * rs/strbuf-getwholeline-fix: strbuf: clear errno before calling getdelim(3)
2017-08-22Merge branch 'rs/merge-microcleanup'Libravatar Junio C Hamano1-2/+2
Code clean-up. * rs/merge-microcleanup: merge: use skip_prefix()
2017-08-22Merge branch 'rs/fsck-obj-leakfix'Libravatar Junio C Hamano1-11/+11
Memory leak in an error codepath has been plugged. * rs/fsck-obj-leakfix: fsck: free buffers on error in fsck_obj()
2017-08-22Merge branch 'rs/t4062-obsd'Libravatar Junio C Hamano1-1/+3
Test portability fix. * rs/t4062-obsd: t4062: use less than 256 repetitions in regex
2017-08-22Merge branch 'rs/find-pack-entry-bisection'Libravatar Junio C Hamano1-2/+2
Code clean-up. * rs/find-pack-entry-bisection: sha1_file: avoid comparison if no packed hash matches the first byte
2017-08-22Merge branch 'rs/apply-lose-prefix-length'Libravatar Junio C Hamano2-8/+5
Code clean-up. * rs/apply-lose-prefix-length: apply: remove prefix_length member from apply_state
2017-08-22Merge branch 'rj/add-chmod-error-message'Libravatar Junio C Hamano1-3/+3
Message fix. * rj/add-chmod-error-message: builtin/add: add detail to a 'cannot chmod' error message
2017-08-22Merge branch 'jk/hashcmp-memcmp'Libravatar Junio C Hamano1-8/+1
Code clean-up. * jk/hashcmp-memcmp: hashcmp: use memcmp instead of open-coded loop
2017-08-22Merge branch 'jk/drop-sha1-entry-pos'Libravatar Junio C Hamano4-238/+1
Code clean-up. * jk/drop-sha1-entry-pos: sha1_file: drop experimental GIT_USE_LOOKUP search
2017-08-22Merge branch 'ur/svn-local-zone'Libravatar Junio C Hamano1-1/+1
"git svn" used with "--localtime" option did not compute the tz offset for the timestamp in question and instead always used the current time, which has been corrected. * ur/svn-local-zone: git svn fetch: Create correct commit timestamp when using --localtime
2017-08-22Merge branch 'pw/am-signoff'Libravatar Junio C Hamano2-45/+64
"git am -s" has been taught that some input may end with a trailer block that is not Signed-off-by: and it should refrain from adding an extra blank line before adding a new sign-off in such a case. * pw/am-signoff: am: fix signoff when other trailers are present
2017-08-22Merge branch 'rs/t3700-clean-leftover'Libravatar Junio C Hamano1-0/+1
A test fix. * rs/t3700-clean-leftover: t3700: fix broken test under !POSIXPERM
2017-08-22Merge branch 'jc/perl-git-comment-typofix'Libravatar Junio C Hamano1-1/+1
A comment fix. * jc/perl-git-comment-typofix: perl/Git.pm: typofix in a comment
2017-08-22Merge branch 'rs/in-obsd-basename-dirname-take-const'Libravatar Junio C Hamano1-2/+16
Portability fix. * rs/in-obsd-basename-dirname-take-const: test-path-utils: handle const parameter of basename and dirname
2017-08-22Merge branch 'rs/obsd-getcwd-workaround'Libravatar Junio C Hamano1-2/+28
Test portability fix for BSDs. * rs/obsd-getcwd-workaround: t0001: skip test with restrictive permissions if getpwd(3) respects them
2017-08-22Merge branch 'mf/no-dashed-subcommands'Libravatar Junio C Hamano5-10/+10
Code clean-up. * mf/no-dashed-subcommands: scripts: use "git foo" not "git-foo"
2017-08-22Merge branch 'ma/parse-maybe-bool'Libravatar Junio C Hamano13-25/+41
Code clean-up. * ma/parse-maybe-bool: parse_decoration_style: drop unused argument `var` treewide: deprecate git_config_maybe_bool, use git_parse_maybe_bool config: make git_{config,parse}_maybe_bool equivalent config: introduce git_parse_maybe_bool_text t5334: document that git push --signed=1 does not work Doc/git-{push,send-pack}: correct --sign= to --signed=
2017-08-22Merge branch 'ab/ref-filter-no-contains'Libravatar Junio C Hamano1-1/+1
A test fix. * ab/ref-filter-no-contains: tests: don't give unportable ">" to "test" built-in, use -gt
2017-08-22Merge branch 'bw/clone-recursive-quiet'Libravatar Junio C Hamano2-0/+9
"git clone --recurse-submodules --quiet" did not pass the quiet option down to submodules. * bw/clone-recursive-quiet: clone: teach recursive clones to respect -q
2017-08-22Merge branch 'bw/grep-recurse-submodules'Libravatar Junio C Hamano20-449/+246
"git grep --recurse-submodules" has been reworked to give a more consistent output across submodule boundary (and do its thing without having to fork a separate process). * bw/grep-recurse-submodules: grep: recurse in-process using 'struct repository' submodule: merge repo_read_gitmodules and gitmodules_config submodule: check for unmerged .gitmodules outside of config parsing submodule: check for unstaged .gitmodules outside of config parsing submodule: remove fetch.recursesubmodules from submodule-config parsing submodule: remove submodule.fetchjobs from submodule-config parsing config: add config_from_gitmodules cache.h: add GITMODULES_FILE macro repository: have the_repository use the_index repo_read_index: don't discard the index
2017-08-22Merge branch 'pw/sequence-rerere-autoupdate'Libravatar Junio C Hamano7-50/+171
Commands like "git rebase" accepted the --rerere-autoupdate option from the command line, but did not always use it. This has been fixed. * pw/sequence-rerere-autoupdate: cherry-pick/revert: reject --rerere-autoupdate when continuing cherry-pick/revert: remember --rerere-autoupdate t3504: use test_commit rebase -i: honor --rerere-autoupdate rebase: honor --rerere-autoupdate am: remember --rerere-autoupdate setting
2017-08-22Merge branch 'bw/push-options-recursively-to-submodules'Libravatar Junio C Hamano3-13/+79
"git push --recurse-submodules $there HEAD:$target" was not propagated down to the submodules, but now it is. * bw/push-options-recursively-to-submodules: submodule--helper: teach push-check to handle HEAD
2017-08-17git-grep: correct exit code with --quiet and -LLibravatar Anthony Sottile2-1/+6
The handling of `status_only` no longer interferes with the handling of `unmatch_name_only`. `--quiet` no longer affects the exit code when using `-L`/`--files-without-match`. Signed-off-by: Anthony Sottile <asottile@umich.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-17files-backend: cheapen refname_available check when locking refsLibravatar Michael Haggerty1-4/+4
When locking references in preparation for updating them, we need to check that none of the newly added references D/F conflict with existing references (e.g., we don't allow `refs/foo` to be added if `refs/foo/bar` already exists, or vice versa). Prior to 524a9fdb51 (refs_verify_refname_available(): use function in more places, 2017-04-16), conflicts with existing loose references were checked by looking directly in the filesystem, and then conflicts with existing packed references were checked by running `verify_refname_available_dir()` against the packed-refs cache. But that commit changed the final check to call `refs_verify_refname_available()` against the *whole* files ref-store, including both loose and packed references, with the following comment: > This means that those callsites now check for conflicts with all > references rather than just packed refs, but the performance cost > shouldn't be significant (and will be regained later). That comment turned out to be too sanguine. User s@kazlauskas.me reported that fetches involving a very large number of references in neighboring directories were slowed down by that change. The problem is that when fetching, each reference is updated individually, within its own reference transaction. This is done because some reference updates might succeed even though others fail. But every time a reference update transaction is finished, `clear_loose_ref_cache()` is called. So when it is time to update the next reference, part of the loose ref cache has to be repopulated for the `refs_verify_refname_available()` call. If the references are all in neighboring directories, then the cost of repopulating the reference cache increases with the number of references, resulting in O(N²) effort. The comment above also claims that the performance cost "will be regained later". The idea was that once the packed-refs were finished being split out into a separate ref-store, we could limit the `refs_verify_refname_available()` call to the packed references again. That is what we do now. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-16commit: skip discarding the index if there is no pre-commit hookLibravatar Kevin Willford1-6/+9
If there is not a pre-commit hook, there is no reason to discard the index and reread it. This change checks to presence of a pre-commit hook and then only discards the index if there was one. Signed-off-by: Kevin Willford <kewillf@microsoft.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15sha1_file: make read_info_alternates staticLibravatar Stefan Beller2-2/+2
read_info_alternates is not used from outside, so let's make it static. We have to declare the function before link_alt_odb_entry instead of moving the code around, link_alt_odb_entry calls read_info_alternates, which in turn calls link_alt_odb_entry. Signed-off-by: Stefan Beller <sbeller@google.com> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-15t1002: stop using sum(1)Libravatar René Scharfe2-35/+35
sum(1) is a command for calculating checksums of the contents of files. It was part of early editions of Unix ("Research Unix", 1972/1973, [1]). cksum(1) appeared in 4.4BSD (1993) as a replacement [2], and became part of POSIX.1-2008 [3]. OpenBSD 5.6 (2014) removed sum(1). We only use sum(1) in t1002 to check for changes in three files. On MinGW we use md5sum(1) instead. We could switch to the standard command cksum(1) for all platforms; MinGW comes with GNU coreutils now, which provides sum(1), cksum(1) and md5sum(1). Use our standard method for checking for file changes instead: test_cmp. It's more convenient because it shows differences nicely, it's faster on MinGW because we have a special implementation there based only on shell-internal commands, it's simpler as it allows us to avoid stripping out unnecessary entries from the checksum file using grep(1), and it's more consistent with the rest of the test suite. We already compare changed files with their expected new contents using diff(1), so we don't need to check with "test_must_fail test_cmp" if they differ from their original state. A later patch could convert the direct diff(1) calls to test_cmp as well. With all sum(1) calls gone, remove the MinGW-specific implementation from test-lib.sh as well. [1] http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/sum.1 [2] http://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/share/man/cat1/cksum.0 [3] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/cksum.html Signed-off-by: René Scharfe <l.s.r@web.de> Reviewed-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14doc: clarify "config --bool" behaviour with empty stringLibravatar Andreas Heiduk2-6/+7
`git config --bool xxx.yyy` returns `true` for `[xxx]yyy` but `false` for `[xxx]yyy=` or `[xxx]yyy=""`. This is tested in t1300-repo-config.sh since 09bc098c2. Signed-off-by: Andreas Heiduk <asheiduk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14stash: prevent warning about null bytes in inputLibravatar Kevin Daudt1-2/+9
The `no_changes` function calls the `untracked_files` function through command substitution. `untracked_files` will return null bytes because it runs ls-files with the '-z' option. Bash since version 4.4 warns about these null bytes. As they are not required for the test that is being done, make sure `untracked_files` does not output null bytes when not required. This is achieved by adding a parameter to the `untracked_files` function to specify wither `-z` should be passed to ls-files or not. This warning is triggered when running git stash save -u resulting in two warnings: git-stash: line 43: warning: command substitution: ignored null byte in input Signed-off-by: Kevin Daudt <me@ikke.info> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14rebase: turn on progress option by default for format-patchLibravatar Kevin Willford2-0/+7
Pass the "--progress" option to format-patch when the standard error stream is connected to the terminal and "--quiet" is not given. Signed-off-by: Kevin Willford <kewillf@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14format-patch: have progress option while generating patchesLibravatar Kevin Willford2-0/+14
When generating patches for the rebase command, if the user does not realize the branch they are rebasing onto is thousands of commits different, there is no progress indication after initial rewinding message. The progress meter as presented in this patch assumes the thousands of patches to have a fine granularity as well as assuming to require all the same amount of work/time for each, such that a steady progress bar is achieved. We do not want to estimate the time for each patch based e.g. on their size or number of touched files (or parents) as that is too expensive for just a progress meter. This patch allows a progress option to be passed to format-patch so that the user can be informed the progress of generating the patch. This option is then used by the rebase command when calling format-patch. Signed-off-by: Kevin Willford <kewillf@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-14hook: use correct logical variableLibravatar Kaartic Sivaraam1-1/+1
Sign-off added should be that of the "committer", not that of the "commit's author"; that is how the rest of Git adds sign-off using sequencer.c::append_signoff(). Use the correct logical variable that identifies the committer. Signed-off-by: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11stash: clean untracked files before resetLibravatar Nicolas Morey-Chaisemartin2-5/+23
If calling git stash -u on a repo that contains a file that is not ignored any more due to a current modification of the gitignore file, this file is stashed but not remove from the working tree. This is due to git-stash first doing a reset --hard which clears the .gitignore file modification and the call git clean, leaving the file untouched. This causes git stash pop to fail due to the file existing. This patch simply switches the order between cleaning and resetting and adds a test for this usecase. Reported-by: Sam Partington <sam@whiteoctober.co.uk> Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11sha1_file: remove read_packed_sha1()Libravatar Jonathan Tan1-25/+1
Use read_object() in its place instead. This avoids duplication of code. This makes force_object_loose() slightly slower (because of a redundant check of loose object storage), but only in the error case. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-11sha1_file: set whence in storage-specific info fnLibravatar Jonathan Tan1-7/+6
Move the setting of oi->whence to sha1_loose_object_info() and packed_object_info(). This allows sha1_object_info_extended() to not need to know about the delta base cache. This will be useful during a future refactoring in which packfile-related functions, including the handling of the delta base cache, will be moved to a separate file. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>