Commit graph

36989 commits

Author SHA1 Message Date
Christian Couder 3fa1025907 replace: add test for --graft with a mergetag
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:07:04 -07:00
Christian Couder 25a05a8cae replace: check mergetags when using --graft
When using --graft, with a mergetag in the original
commit, we should check that the commit pointed to by
the mergetag is still a parent of then new commit we
create, otherwise the mergetag could be misleading.

If the commit pointed to by the mergetag is no more
a parent of the new commit, we could remove the
mergetag, but in this case there is a good chance
that the title or other elements of the commit might
also be misleading. So let's just error out and
suggest to use --edit instead on the commit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:06:49 -07:00
Christian Couder 60e2f5a5af replace: add test for --graft with signed commit
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:06:20 -07:00
Christian Couder 0b05ab6f1b replace: remove signature when using --graft
It could be misleading to keep a signature in a
replacement commit, so let's remove it.

Note that there should probably be a way to sign
the replacement commit created when using --graft,
but this can be dealt with in another commit or
patch series.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:05:58 -07:00
Christian Couder b0ab2b71d0 contrib: add convert-grafts-to-replace-refs.sh
This patch adds into contrib/ an example script to convert
grafts from an existing grafts file into replace refs using
the new --graft option of "git replace".

While at it let's mention this new script in the
"git replace" documentation for the --graft option.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:05:53 -07:00
Christian Couder 78024c4e31 Documentation: replace: add --graft option
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:05:47 -07:00
Christian Couder adf8e54238 replace: add test for --graft
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:04:40 -07:00
Christian Couder 4228e8bc98 replace: add --graft option
The usage string for this option is:

git replace [-f] --graft <commit> [<parent>...]

First we create a new commit that is the same as <commit>
except that its parents are [<parents>...]

Then we create a replace ref that replace <commit> with
the commit we just created.

With this new option, it should be straightforward to
convert grafts to replace refs.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-21 12:04:23 -07:00
Christian Couder 1c2828c194 replace: cleanup redirection style in tests
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-07 15:33:17 -07:00
Christian Couder 063da62b02 commit: add for_each_mergetag()
In the same way as there is for_each_ref() to iterate on refs,
for_each_mergetag() allows the caller to iterate on the mergetags of
a given commit.  Use it to rewrite show_mergetag() used in "git log".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-07 15:32:21 -07:00
Junio C Hamano 6f92e5ff3c Merge branch 'dt/refs-check-refname-component-sse'
Further micro-optimization of a leaf-function.

* dt/refs-check-refname-component-sse:
  refs.c: SSE2 optimizations for check_refname_component
2014-07-02 12:53:07 -07:00
Junio C Hamano a02ad882a1 Merge branch 'ye/http-extract-charset'
* ye/http-extract-charset:
  http: fix charset detection of extract_content_type()
2014-07-02 12:53:05 -07:00
Junio C Hamano 6293aea559 Merge branch 'bc/fix-rebase-merge-skip'
"git rebase --skip" did not work well when it stopped due to a
conflict twice in a row.

* bc/fix-rebase-merge-skip:
  rebase--merge: fix --skip with two conflicts in a row
2014-07-02 12:53:04 -07:00
Junio C Hamano 8061ae8b46 Merge branch 'jk/commit-buffer-length'
Move "commit->buffer" out of the in-core commit object and keep
track of their lengths.  Use this to optimize the code paths to
validate GPG signatures in commit objects.

* jk/commit-buffer-length:
  reuse cached commit buffer when parsing signatures
  commit: record buffer length in cache
  commit: convert commit->buffer to a slab
  commit-slab: provide a static initializer
  use get_commit_buffer everywhere
  convert logmsg_reencode to get_commit_buffer
  use get_commit_buffer to avoid duplicate code
  use get_cached_commit_buffer where appropriate
  provide helpers to access the commit buffer
  provide a helper to set the commit buffer
  provide a helper to free commit buffer
  sequencer: use logmsg_reencode in get_message
  logmsg_reencode: return const buffer
  do not create "struct commit" with xcalloc
  commit: push commit_index update into alloc_commit_node
  alloc: include any-object allocations in alloc_report
  replace dangerous uses of strbuf_attach
  commit_tree: take a pointer/len pair rather than a const strbuf
2014-07-02 12:53:02 -07:00
Ronnie Sahlberg 95acfc2479 enums: remove trailing ',' after last item in enum
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-02 12:52:55 -07:00
Junio C Hamano 64d845477b Merge branch 'maint'
* maint:
  t7300: repair filesystem permissions with test_when_finished
  enums: remove trailing ',' after last item in enum
2014-07-02 12:52:46 -07:00
Junio C Hamano c2f7b1026e Merge branch 'maint-1.8.5' into maint
* maint-1.8.5:
  t7300: repair filesystem permissions with test_when_finished
  enums: remove trailing ',' after last item in enum
2014-07-02 12:51:50 -07:00
Jeff King 45067fc973 t7300: repair filesystem permissions with test_when_finished
We create a directory that cannot be removed, confirm that
it cannot be removed, and then fix it like:

  chmod 0 foo &&
  test_must_fail git clean -d -f &&
  chmod 755 foo

If the middle step fails but leaves the directory (e.g., the
bug is that clean does not notice the failure), this
pollutes the test repo with an unremovable directory. Not
only does this cause further tests to fail, but it means
that "rm -rf" fails on the whole trash directory, and the
user has to intervene manually to even re-run the test script.

We can bump the "chmod 755" recovery to a test_when_finished
block to be sure that it always runs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-02 12:51:38 -07:00
Ronnie Sahlberg 782735203c enums: remove trailing ',' after last item in enum
Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-07-02 12:37:05 -07:00
Junio C Hamano 7fe6834801 Merge git://ozlabs.org/~paulus/gitk
* git://ozlabs.org/~paulus/gitk:
  gitk: Add visiblerefs option, which lists always-shown branches
  gitk: Catch mkdtemp errors
  gitk: Use mktemp -d to avoid predictable temporary directories
  gitk: Honor TMPDIR when viewing external diffs
2014-06-27 11:23:03 -07:00
Max Kirillov bde4a0f9f3 gitk: Add visiblerefs option, which lists always-shown branches
When many branches contain a commit, the branches used to be shown in
the form "A, B and many more", where A, B can be master of current
HEAD. But there are more which might be interesting to always know about.
For example, "origin/master".

The new option, visiblerefs, is stored in ~/.gitk. It contains a list
of references which are always shown before "and many more" if they
contain the commit. By default it is `{"master"}', which is compatible
with previous behavior.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2014-06-27 16:37:14 +10:00
David Aguilar ac54a4b771 gitk: Catch mkdtemp errors
105b5d3f ("gitk: Use mktemp -d to avoid predictable temporary
directories") introduced a dependency on mkdtemp, which is not
available on Windows.

Use the original temporary directory behavior when mkdtemp fails.
This makes the code use mkdtemp when available and gracefully
fallback to the existing behavior when it is not available.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2014-06-27 16:30:39 +10:00
Junio C Hamano ea0e524ebd Merge early parts from git://ozlabs.org/~paulus/gitk.git
* master~2:
  gitk: Show staged submodules regardless of ignore config
  gitk: Allow displaying time zones from author and commit dates timestamps
  gitk: Switch to patch mode when searching for line origin
  gitk: Replace SHA1 entry field on keyboard paste
  l10n: Init Vietnamese translation
2014-06-26 13:46:09 -07:00
Junio C Hamano ad1c66033e Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: tolerate major version changes when comparing the git version
  git-gui: show staged submodules regardless of ignore config
2014-06-26 13:44:11 -07:00
Junio C Hamano c47372d3a8 Sync with maint 2014-06-25 12:32:58 -07:00
Junio C Hamano 369a70fc77 Fifth batch for 2.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-25 12:32:23 -07:00
Junio C Hamano 597072314c Merge branch 'jm/dedup-name-compare'
* jm/dedup-name-compare:
  cleanup duplicate name_compare() functions
  name-hash.c: replace cache_name_compare() with memcmp(3)
2014-06-25 12:23:57 -07:00
Junio C Hamano e56857246a Merge branch 'ep/avoid-test-a-o'
Update tests and scripts to avoid "test ... -a ...", which is often
more error-prone than "test ... && test ...".

Squashed misconversion fix-up into git-submodule.sh updates.

* ep/avoid-test-a-o:
  git-submodule.sh: avoid "echo" path-like values
  git-submodule.sh: avoid "test <cond> -a/-o <cond>"
  t/test-lib-functions.sh: avoid "test <cond> -a/-o <cond>"
  t/t9814-git-p4-rename.sh: avoid "test <cond> -a/-o <cond>"
  t/t5538-push-shallow.sh: avoid "test <cond> -a/-o <cond>"
  t/t5403-post-checkout-hook.sh: avoid "test <cond> -a/-o <cond>"
  t/t5000-tar-tree.sh: avoid "test <cond> -a/-o <cond>"
  t/t4102-apply-rename.sh: avoid "test <cond> -a/-o <cond>"
  t/t0026-eol-config.sh: avoid "test <cond> -a/-o <cond>"
  t/t0025-crlf-auto.sh: avoid "test <cond> -a/-o <cond>"
  t/lib-httpd.sh: avoid "test <cond> -a/-o <cond>"
  git-rebase--interactive.sh: avoid "test <cond> -a/-o <cond>"
  git-mergetool.sh: avoid "test <cond> -a/-o <cond>"
  git-bisect.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-resolve.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-repack.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-merge.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-commit.sh: avoid "test <cond> -a/-o <cond>"
  contrib/examples/git-clone.sh: avoid "test <cond> -a/-o <cond>"
  check_bindir: avoid "test <cond> -a/-o <cond>"
2014-06-25 12:23:56 -07:00
Junio C Hamano 5b9b715f94 Merge branch 'tb/unicode-7.0-display-width'
* tb/unicode-7.0-display-width:
  Update of unicode_width.h to Unicode Version 7.0
2014-06-25 12:23:54 -07:00
Junio C Hamano ccca6b6523 Merge branch 'ye/doc-http-proto'
* ye/doc-http-proto:
  http-protocol.txt: Basic Auth is defined in RFC 2617, not RFC 2616
2014-06-25 12:23:52 -07:00
Junio C Hamano 8d87e35bab Merge branch 'rs/blame-refactor'
* rs/blame-refactor:
  blame: simplify prepare_lines()
  blame: factor out get_next_line()
2014-06-25 12:23:36 -07:00
Junio C Hamano 35869f4c62 Merge branch 'pb/trim-trailing-spaces'
* pb/trim-trailing-spaces:
  t0008: do not depend on 'echo' handling backslashes specially
2014-06-25 12:23:34 -07:00
Junio C Hamano b47761dd1e Merge branch 'mc/doc-submodule-sync-recurse'
* mc/doc-submodule-sync-recurse:
  submodule: document "sync --recursive"
2014-06-25 12:23:29 -07:00
Junio C Hamano af6ba0eb9e Merge branch 'sp/complete-ext-alias'
* sp/complete-ext-alias:
  completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliases
2014-06-25 12:23:27 -07:00
Junio C Hamano 2a20f4b7e2 Merge branch 'mc/git-p4-prepare-p4-only'
* mc/git-p4-prepare-p4-only:
  git-p4: fix submit in non --prepare-p4-only mode
2014-06-25 12:23:24 -07:00
Junio C Hamano 25f3119000 Merge branch 'jk/repack-pack-writebitmaps-config'
* jk/repack-pack-writebitmaps-config:
  t7700: drop explicit --no-pack-kept-objects from .keep test
  repack: introduce repack.writeBitmaps config option
  repack: simplify handling of --write-bitmap-index
  pack-objects: stop respecting pack.writebitmaps
2014-06-25 12:23:19 -07:00
Junio C Hamano b30adaac52 Merge branch 'nd/init-restore-env'
Some subcommands do not want to be aliased because of the side
effects that happens while the definitions of the aliases are looked
up from configuration system.

* nd/init-restore-env:
  git potty: restore environments after alias expansion
2014-06-25 12:22:00 -07:00
Junio C Hamano b7ce583682 Merge branch 'jk/repack-pack-keep-objects'
Recent updates to "git repack" started to duplicate objects that
are in packfiles marked with .keep flag into the new packfile by
mistake.

* jk/repack-pack-keep-objects:
  repack: s/write_bitmap/&s/ in code
  repack: respect pack.writebitmaps
  repack: do not accidentally pack kept objects by default
2014-06-25 12:21:51 -07:00
Junio C Hamano 9ce7100b1c Merge branch 'fr/sequencer-fail-with-not-one-upon-no-ff'
* fr/sequencer-fail-with-not-one-upon-no-ff:
  sequencer: signal failed ff as an aborted, not a conflicted merge
2014-06-25 12:21:45 -07:00
Junio C Hamano 341e7e8eda Git 2.0.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-06-25 12:21:11 -07:00
Junio C Hamano 62bfd831bc Merge branch 'na/no-http-test-in-the-middle' into maint
The mode to run tests with HTTP server tests disabled was broken.

* na/no-http-test-in-the-middle:
  t5538: move http push tests out to t5542
2014-06-25 11:50:13 -07:00
Junio C Hamano 287a8701f6 Merge branch 'jl/status-added-submodule-is-never-ignored' into maint
"git status" (and "git commit") behaved as if changes in a modified
submodule are not there if submodule.*.ignore configuration is set,
which was misleading.  The configuration is only to unclutter diff
output during the course of development, and should not to hide
changes in the "status" output to cause the users forget to commit
them.

* jl/status-added-submodule-is-never-ignored:
  commit -m: commit staged submodules regardless of ignore config
  status/commit: show staged submodules regardless of ignore config
2014-06-25 11:50:03 -07:00
Junio C Hamano 1881d2b88c Merge branch 'ym/fix-opportunistic-index-update-race' into maint
"git status", even though it is a read-only operation, tries to
update the index with refreshed lstat(2) info to optimize future
accesses to the working tree opportunistically, but this could
race with a "read-write" operation that modify the index while it
is running.  Detect such a race and avoid overwriting the index.

* ym/fix-opportunistic-index-update-race:
  read-cache.c: verify index file before we opportunistically update it
  wrapper.c: add xpread() similar to xread()
2014-06-25 11:49:48 -07:00
Junio C Hamano 85785df6d6 Merge branch 'mk/show-s-no-extra-blank-line-for-merges' into maint
"git show -s" (i.e. show log message only) used to incorrectly emit
an extra blank line after a merge commit.

* mk/show-s-no-extra-blank-line-for-merges:
  git-show: fix 'git show -s' to not add extra terminator after merge commit
2014-06-25 11:49:39 -07:00
Junio C Hamano d9036cd28c Merge branch 'rr/rebase-autostash-fix' into maint
The autostash mode of "git rebase -i" did not restore the dirty
working tree state if the user aborted the interactive rebase by
emptying the insn sheet.

* rr/rebase-autostash-fix:
  rebase -i: test "Nothing to do" case with autostash
  rebase -i: handle "Nothing to do" case with autostash
2014-06-25 11:49:31 -07:00
Junio C Hamano 8675779454 Merge branch 'jc/shortlog-ref-exclude' into maint
"git log --exclude=<glob> --all | git shortlog" worked as expected,
but "git shortlog --exclude=<glob> --all", which is supposed to be
identical to the above pipeline, was not accepted at the command
line argument parser level.

* jc/shortlog-ref-exclude:
  shortlog: allow --exclude=<glob> to be passed
2014-06-25 11:49:11 -07:00
Junio C Hamano c4f79d13b9 Merge branch 'jl/remote-rm-prune' into maint
"git remote rm" and "git remote prune" can involve removing many
refs at once, which is not a very efficient thing to do when very
many refs exist in the packed-refs file.

* jl/remote-rm-prune:
  remote prune: optimize "dangling symref" check/warning
  remote: repack packed-refs once when deleting multiple refs
  remote rm: delete remote configuration as the last
2014-06-25 11:49:01 -07:00
Junio C Hamano ada8710e63 Merge branch 'fc/rerere-conflict-style' into maint
"git rerere forget" did not work well when merge.conflictstyle
was set to a non-default value.

* fc/rerere-conflict-style:
  rerere: fix for merge.conflictstyle
2014-06-25 11:48:54 -07:00
Junio C Hamano 5327207e0f Merge branch 'rs/pack-objects-no-unnecessary-realloc' into maint
"git pack-objects" unnecessarily copied the previous contents when
extending the hashtable, even though it will populate the table
from scratch anyway.

* rs/pack-objects-no-unnecessary-realloc:
  pack-objects: use free()+xcalloc() instead of xrealloc()+memset()
2014-06-25 11:48:43 -07:00
Junio C Hamano 5fa38cc3a4 Merge branch 'dt/merge-recursive-case-insensitive' into maint
On a case insensitive filesystem, merge-recursive incorrectly
deleted the file that is to be renamed to a name that is the same
except for case differences.

* dt/merge-recursive-case-insensitive:
  mv: allow renaming to fix case on case insensitive filesystems
  merge-recursive.c: fix case-changing merge bug
2014-06-25 11:48:34 -07:00