1
0
mirror of https://github.com/git/git.git synced 2024-10-21 05:48:38 +02:00
Commit Graph

22567 Commits

Author SHA1 Message Date
Junio C Hamano
c6d72c4972 Revert clock-skew based attempt to optimize tag --contains traversal
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-07-14 11:02:06 -07:00
Jeff King
188c35e36d git skew: a tool to find how big a clock skew exists in the history
> As you probably guessed from the specificity of the number, I wrote a
> short program to actually traverse and find the worst skew. It takes
> about 5 seconds to run (unsurprisingly, since it is doing the same full
> traversal that we end up doing in the above numbers). So we could
> "autoskew" by setting up the configuration on clone, and then
> periodically updating it as part of "git gc".

This patch doesn't implement auto-detection of skew, but is the program
I used to calculate, and would provide the basis for such
auto-detection. It would be interesting to see average skew numbers for
popular repositories. You can run it as "git skew --all".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-30 12:21:13 -07:00
Jeff King
de9f14e26a default core.clockskew variable to one day
This is the slop value used by name-rev, so presumably is a
reasonable default.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-11 22:32:30 -07:00
Jeff King
0c811a7a6f limit "contains" traversals based on commit timestamp
When looking for commits that contain other commits (e.g.,
via "git tag --contains"), we can end up traversing useless
portions of the graph. For example, if I am looking for a
tag that contains a commit made last week, there is not much
point in traversing portions of the history graph made five
years ago.

This optimization can provide massive speedups. For example,
doing "git tag --contains HEAD~200" in the linux-2.6
repository goes from:

  real    0m5.302s
  user    0m5.116s
  sys     0m0.184s

to:

  real    0m0.030s
  user    0m0.020s
  sys     0m0.008s

The downside is that we will no longer find some answers in
the face of extreme clock skew, as we will stop the
traversal early when seeing commits skewed too far into the
past.

Name-rev already implements a similar optimization, using a
"slop" of one day to allow for a certain amount of clock
skew in commit timestamps. This patch introduces a
"core.clockskew" variable, which allows specifying the
allowable amount of clock skew in seconds.  For safety, it
defaults to "none", causing a full traversal (i.e., no
change in behavior from previous versions).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-11 22:32:30 -07:00
Jeff King
ffc4b8012d tag: speed up --contains calculation
When we want to know if commit A contains commit B (or any
one of a set of commits, B through Z), we generally
calculate the merge bases and see if B is a merge base of A
(or for a set, if any of the commits B through Z have that
property).

When we are going to check a series of commits A1 through An
to see whether each contains B (e.g., because we are
deciding which tags to show with "git tag --contains"), we
do a series of merge base calculations. This can be very
expensive, as we repeat a lot of traversal work.

Instead, let's leverage the fact that we are going to use
the same --contains list for each tag, and mark areas of the
commit graph is definitely containing those commits, or
definitely not containing those commits. Later tags can then
stop traversing as soon as they see a previously calculated
answer.

This sped up "git tag --contains HEAD~200" in the linux-2.6
repository from:

  real    0m15.417s
  user    0m15.197s
  sys     0m0.220s

to:

  real    0m5.329s
  user    0m5.144s
  sys     0m0.184s

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-06-11 22:32:25 -07:00
Junio C Hamano
45e9a825ed Git 1.7.2-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.2-rc1
2010-06-30 15:49:18 -07:00
Junio C Hamano
88202b9ce6 git.spec.in: Add gitweb subpackage
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-30 15:49:18 -07:00
Junio C Hamano
2927a507bf Merge branch 'ar/decorate-color'
* ar/decorate-color:
  Add test for correct coloring of git log --decoration
  Allow customizable commit decorations colors
  log --decorate: Colorize commit decorations
  log-tree.c: Use struct name_decoration's type for classifying decoration
  commit.h: add 'type' to struct name_decoration
2010-06-30 11:55:40 -07:00
Junio C Hamano
54ed6a98fd Merge branch 'mg/doc-rev-parse-treepath-syntax'
* mg/doc-rev-parse-treepath-syntax:
  git-rev-parse.txt: Add more examples for caret and colon
  git-rev-parse.txt: Document ":path" specifier
2010-06-30 11:55:40 -07:00
Junio C Hamano
01aedc930b Merge branch 'cc/cherry-pick-stdin'
* cc/cherry-pick-stdin:
  revert: do not rebuild argv on heap
  revert: accept arbitrary rev-list options
  t3508 (cherry-pick): futureproof against unmerged files
2010-06-30 11:55:39 -07:00
Junio C Hamano
a76b2084fb Merge branch 'jl/status-ignore-submodules'
* jl/status-ignore-submodules:
  Add the option "--ignore-submodules" to "git status"
  git submodule: ignore dirty submodules for summary and status

Conflicts:
	builtin/commit.c
	t/t7508-status.sh
	wt-status.c
	wt-status.h
2010-06-30 11:55:39 -07:00
Junio C Hamano
978327f97d Merge branch 'jk/url-decode'
* jk/url-decode:
  url_decode: URL scheme ends with a colon and does not require a slash
2010-06-30 11:55:38 -07:00
Junio C Hamano
6f82be0519 Merge branch 'jn/grep-open'
* jn/grep-open:
  t/t7811-grep-open.sh: remove broken/redundant creation of fake "less" script
  t/t7811-grep-open.sh: ensure fake "less" is made executable
  t/lib-pager.sh: remove unnecessary '^' from 'expr' regular expression
  grep -O: allow optional argument specifying the pager (or editor)
  grep: Add the option '--open-files-in-pager'
  Unify code paths of threaded greps
  grep: refactor grep_objects loop into its own function

Conflicts:
	t/t7006-pager.sh
2010-06-30 11:55:38 -07:00
Junio C Hamano
a53deac89e Merge branch 'jp/string-list-api-cleanup'
* jp/string-list-api-cleanup:
  string_list: Fix argument order for string_list_append
  string_list: Fix argument order for string_list_lookup
  string_list: Fix argument order for string_list_insert_at_index
  string_list: Fix argument order for string_list_insert
  string_list: Fix argument order for for_each_string_list
  string_list: Fix argument order for print_string_list
2010-06-30 11:55:38 -07:00
Junio C Hamano
6296062285 Merge branch 'tr/rev-list-count'
* tr/rev-list-count:
  bash completion: Support "divergence from upstream" messages in __git_ps1
  rev-list: introduce --count option

Conflicts:
	contrib/completion/git-completion.bash
2010-06-30 11:55:38 -07:00
Junio C Hamano
304d8b6256 Merge branch 'as/maint-completion-set-u-fix'
* as/maint-completion-set-u-fix:
  bash-completion: Fix __git_ps1 to work with "set -u"
2010-06-30 11:55:37 -07:00
Junio C Hamano
8b3120dbaf Merge branch 'mg/rev-parse-tests'
* mg/rev-parse-tests:
  t6018: make sure all tested symbolic names are different revs
  t6018: add tests for rev-list's --branches and --tags
2010-06-30 11:55:37 -07:00
Junio C Hamano
e1165dd144 Merge branch 'jl/maint-diff-ignore-submodules'
* jl/maint-diff-ignore-submodules:
  t4027,4041: Use test -s to test for an empty file
  Add optional parameters to the diff option "--ignore-submodules"
  git diff: rename test that had a conflicting name
2010-06-30 11:55:37 -07:00
Nazri Ramliy
567102819a Add test for correct coloring of git log --decoration
Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-30 11:14:44 -07:00
Junio C Hamano
c9eaaab416 Sync with 1.7.1.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-29 11:24:36 -07:00
Jonathan Nieder
e0ef8495e9 revert: do not rebuild argv on heap
Set options in struct rev_info directly so we can reuse the
arguments collected from parse_options without modification.

This is just a cleanup; no noticeable change is intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-29 10:36:13 -07:00
Junio C Hamano
65281b70ca Merge commit 'v1.7.2-rc0~6^2' into cc/cherry-pick-stdin
* commit 'v1.7.2-rc0~6^2':
  DWIM 'git show -5' to 'git show --do-walk -5'
  Documentation/SubmittingPatches: Fix typo in GMail section
  Documentation/config: describe status.submodulesummary

This commit fixes one test in t3508 by making "cherry-pick -<num>"
walk the history.

A test update from Elijah Newren is squashed as an evil merge.
2010-06-29 10:22:55 -07:00
Junio C Hamano
a146392056 Git 1.7.1.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.1.1
2010-06-29 09:59:56 -07:00
Brandon Casey
3183286238 t/t9001: use egrep when regular expressions are involved
Supplying backslashed, extended regular expressions to grep is not
portable.  Use egrep instead.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-29 09:31:48 -07:00
Michael J Gruber
b8a6610d84 git-rev-parse.txt: Add more examples for caret and colon
Several items in the caret, colon and friends section contain examples
already. Make sure they all come with examples, and that examples come
early so that they serve as a visual guide, as well.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-29 08:48:19 -07:00
Junio C Hamano
1ba5c532e1 Merge branch 'maint'
* maint:
  Update draft release notes to 1.7.1.1
  notes: Initialise variable to appease gcc
  notes: check number of parameters to "git notes copy"
2010-06-28 17:42:26 -07:00
Junio C Hamano
edac1883dc Update draft release notes to 1.7.1.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 17:42:18 -07:00
Junio C Hamano
54fcb21b89 Merge branch 'tr/send-email-8bit' into maint
* tr/send-email-8bit:
  send-email: ask about and declare 8bit mails
2010-06-28 16:19:03 -07:00
Junio C Hamano
d60ad81e68 Merge branch 'pb/maint-perl-errmsg-no-dir' into maint
* pb/maint-perl-errmsg-no-dir:
  Git.pm: better error message
2010-06-28 16:18:58 -07:00
Junio C Hamano
339aec7acb Merge branch 'js/maint-am-rebase-invalid-author' into maint
* js/maint-am-rebase-invalid-author:
  am: use get_author_ident_from_commit instead of mailinfo when rebasing
2010-06-28 16:18:43 -07:00
Junio C Hamano
6c1c4423e2 Merge branch 'jc/maint-simpler-common-prefix' into maint
* jc/maint-simpler-common-prefix:
  common_prefix: simplify and fix scanning for prefixes
2010-06-28 16:18:15 -07:00
Junio C Hamano
54dc783766 Merge branch 'bd/maint-unpack-trees-parawalk-fix' into maint
* bd/maint-unpack-trees-parawalk-fix:
  unpack-trees: Make index lookahead less pessimal
2010-06-28 16:18:02 -07:00
Ramsay Jones
89fe121d5f notes: Initialise variable to appease gcc
gcc version 3.4.4 thinks that the 'cmp' variable could be used
while uninitialised and complains thus:

    notes.c: In function `write_each_non_note_until':
    notes.c:719: warning: 'cmp' might be used uninitialized in \
        this function

Note that gcc versions 4.1.2 and 4.4.0 do not issue this warning.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 10:01:26 -07:00
Jeff King
bbb1b8a35a notes: check number of parameters to "git notes copy"
Otherwise we may segfault with too few parameters.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Bert Wesarg <Bert.Wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-28 09:15:15 -07:00
Ramsay Jones
078e9bce1e msvc: Select the "fast" definition of the {get,put}_be32() macros
On Intel machines, the msvc compiler defines the CPU architecture
macros _M_IX86 and _M_X64 (equivalent to __i386__ and __x86_64__
respectively). Use these macros in the pre-processor expression
to select the "fast" definition of the {get,put}_be32() macros.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 21:59:32 -07:00
Michael J Gruber
3f3abe3c5a git-rev-parse.txt: Document ":path" specifier
The empty treeish in ":path" means "index". This is actually a special
case of the ":stage:path" syntax where it is documented, but mentioning
it also together with "treeish:path" is helpful, so do it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 12:25:37 -07:00
Junio C Hamano
492b10766f Git 1.7.2-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.2-rc0
2010-06-27 12:16:06 -07:00
Junio C Hamano
cf4403a010 Merge branch 'cp/textconv-cat-file'
* cp/textconv-cat-file:
  git-cat-file.txt: Document --textconv
  t/t8007: test textconv support for cat-file
  textconv: support for cat_file
  sha1_name: add get_sha1_with_context()
2010-06-27 12:07:55 -07:00
Junio C Hamano
6aa206413a Merge branch 'pb/maint-perl-errmsg-no-dir'
* pb/maint-perl-errmsg-no-dir:
  Git.pm: better error message
2010-06-27 12:07:45 -07:00
Junio C Hamano
a278aa61a4 Merge branch 'tr/send-email-8bit'
* tr/send-email-8bit:
  send-email: ask about and declare 8bit mails
2010-06-27 12:07:45 -07:00
Junio C Hamano
bcdfb20ae9 Merge branch 'js/maint-am-rebase-invalid-author'
* js/maint-am-rebase-invalid-author:
  am: use get_author_ident_from_commit instead of mailinfo when rebasing
2010-06-27 12:07:44 -07:00
Junio C Hamano
4af574dbdc Merge branch 'ab/blame-textconv'
* ab/blame-textconv:
  t/t8006: test textconv support for blame
  textconv: support for blame
  textconv: make the API public

Conflicts:
	diff.h
2010-06-27 12:07:44 -07:00
Junio C Hamano
a81f1a825b Merge branch 'jn/show-num-walks'
* jn/show-num-walks:
  DWIM 'git show -5' to 'git show --do-walk -5'
2010-06-27 12:07:44 -07:00
Michael J Gruber
52663475a9 t6018: make sure all tested symbolic names are different revs
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 11:32:43 -07:00
Michael J Gruber
9332441d8e t6018: add tests for rev-list's --branches and --tags
so that we know when they break.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 11:32:43 -07:00
Julian Phillips
0c72cead84 Merge branch 'jp/string-list-api-cleanup' into jn/grep-open
An evil merge to adjust the series to cleaned-up API.

  From: Julian Phillips <julian@quantumfyre.co.uk>
  Subject: [PATCH v2 7/7] grep: fix string_list_append calls
  Date: Sat, 26 Jun 2010 00:41:39 +0100
  Message-ID: <20100625234140.18927.35025.julian@quantumfyre.co.uk>

* jp/string-list-api-cleanup:
  string_list: Fix argument order for string_list_append
  string_list: Fix argument order for string_list_lookup
  string_list: Fix argument order for string_list_insert_at_index
  string_list: Fix argument order for string_list_insert
  string_list: Fix argument order for for_each_string_list
  string_list: Fix argument order for print_string_list

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 10:17:18 -07:00
Julian Phillips
1d2f80fa79 string_list: Fix argument order for string_list_append
Update the definition and callers of string_list_append to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 10:06:52 -07:00
Julian Phillips
e8c8b7139c string_list: Fix argument order for string_list_lookup
Update the definition and callers of string_list_lookup to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 10:06:51 -07:00
Julian Phillips
aadceea641 string_list: Fix argument order for string_list_insert_at_index
Update the definition and callers of string_list_insert_at_index to
use the string_list as the first argument.  This helps make the
string_list API easier to use by being more consistent.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 10:06:51 -07:00
Julian Phillips
78a395d371 string_list: Fix argument order for string_list_insert
Update the definition and callers of string_list_insert to use the
string_list as the first argument.  This helps make the string_list
API easier to use by being more consistent.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-27 10:06:51 -07:00