1
0
mirror of https://github.com/git/git.git synced 2024-10-19 05:59:13 +02:00
Commit Graph

27356 Commits

Author SHA1 Message Date
Junio C Hamano
795283c415 Merge branch 'dw/gitweb-doc-grammo' into maint-1.7.8
* dw/gitweb-doc-grammo:
  Documentation/gitweb: trivial English fixes
2012-04-09 13:42:56 -07:00
Junio C Hamano
6d5c16a90c Merge branch 'tr/cache-tree' into maint-1.7.8
* tr/cache-tree:
  t0090: be prepared that 'wc -l' writes leading blanks
  reset: update cache-tree data when appropriate
  commit: write cache-tree data when writing index anyway
  Refactor cache_tree_update idiom from commit
  Test the current state of the cache-tree optimization
  Add test-scrap-cache-tree
2012-04-09 13:40:32 -07:00
Junio C Hamano
00fb2d2563 Merge branch 'cb/maint-t5541-make-server-port-portable' into maint-1.7.8
* cb/maint-t5541-make-server-port-portable:
  t5541: check error message against the real port number used
  remote-curl: Fix push status report when all branches fail
2012-04-09 13:38:41 -07:00
Junio C Hamano
fc2d99f1e9 Merge branch 'cn/maint-rev-list-doc' into maint-1.7.8
* cn/maint-rev-list-doc:
  Documentation: use {asterisk} in rev-list-options.txt when needed
2012-04-09 13:36:44 -07:00
Junio C Hamano
50c9403284 Merge branch 'tr/maint-bundle-boundary' into maint-1.7.8
* tr/maint-bundle-boundary:
  bundle: keep around names passed to add_pending_object()
  t5510: ensure we stay in the toplevel test dir
  t5510: refactor bundle->pack conversion
2012-04-09 13:36:26 -07:00
Junio C Hamano
8502a779da Merge branch 'tr/maint-bundle-long-subject' into maint-1.7.8
* tr/maint-bundle-long-subject:
  t5704: match tests to modern style
  strbuf: improve strbuf_get*line documentation
  bundle: use a strbuf to scan the log for boundary commits
  bundle: put strbuf_readline_fd in strbuf.c with adjustments
2012-04-09 13:36:20 -07:00
Junio C Hamano
dbdc07fcbe Merge branch 'ph/rerere-doc' into maint-1.7.8
* ph/rerere-doc:
  rerere: Document 'rerere remaining'
2012-04-09 13:34:09 -07:00
D Waitzman
c32c959165 Documentation/gitweb: trivial English fixes
Change "it's" to "its" where a possessive is intended.  Also add two
missing "the" that were noticed by Ben Walton.

Signed-off-by: David Waitzman <djw@bbn.com>
2012-03-23 11:22:04 -07:00
Junio C Hamano
d4c813d47d Merge branch 'ks/sort-wildcard-in-makefile' into maint-1.7.8
* ks/sort-wildcard-in-makefile:
  t/Makefile: Use $(sort ...) explicitly where needed
2012-03-20 15:26:19 -07:00
Junio C Hamano
39af78961d Merge branch 'jc/advise-i18n' into maint-1.7.8
* jc/advise-i18n:
  i18n of multi-line advice messages
2012-03-20 15:25:38 -07:00
Junio C Hamano
bd193f46b7 Merge branch 'jn/gitweb-unspecified-action' into maint-1.7.8
* jn/gitweb-unspecified-action:
  gitweb: Fix actionless dispatch for non-existent objects
2012-03-20 15:24:23 -07:00
Phil Hord
3e7a1df84d rerere: Document 'rerere remaining'
This adds the 'remaining' command to the documentation of
'git rerere'. This command was added in ac49f5ca (Feb 16 2011;
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>) but
it was never documented.

Touch up the other rerere commands to reduce noise.

First noticed by Vincent van Ravesteijn.

Signed-off-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-08 14:40:44 -08:00
Junio C Hamano
e521850bfd Merge branch 'maint-1.7.7' into maint-1.7.8
By Thomas Rast
* maint-1.7.7:
  Document the --histogram diff option
2012-03-06 12:04:48 -08:00
Thomas Rast
d909e0761c Document the --histogram diff option
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-06 11:53:29 -08:00
Thomas Rast
efe4be1249 bundle: keep around names passed to add_pending_object()
The 'name' field passed to add_pending_object() is used to later
deduplicate in object_array_remove_duplicates().

git-bundle had a bug in this area since 18449ab (git-bundle: avoid
packing objects which are in the prerequisites, 2007-03-08): it passed
the name of each boundary object in a static buffer.  In other words,
all that object_array_remove_duplicates() saw was the name of the
*last* added boundary object.

The recent switch to a strbuf in bc2fed4 (bundle: use a strbuf to scan
the log for boundary commits, 2012-02-22) made this slightly worse: we
now free the buffer at the end, so it is not even guaranteed that it
still points into addressable memory by the time object_array_remove_
duplicates looks at it.  On the plus side however, it was now
detectable by valgrind.

The fix is easy: pass a copy of the string to add_pending_object.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:34:42 -08:00
Thomas Rast
aa9828561e t5510: ensure we stay in the toplevel test dir
The last test descended into a subdir without ever re-emerging, which
is not so nice to the next test writer.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:34:14 -08:00
Thomas Rast
61821aaa12 t5510: refactor bundle->pack conversion
It's not so much a conversion as a "strip everything up to and
including the first blank line", but it will come in handy again.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 14:25:57 -08:00
Carlos Martín Nieto
e34bb2e7fd Documentation: use {asterisk} in rev-list-options.txt when needed
Text between two '*' is emphasized in AsciiDoc and makes explanations in
rev-list-options.txt on glob-related options very confusing, as the
rendered text would be missing two asterisks and the text between them
would be emphasized instead.

Use '{asterisk}' where needed to make them show up as asterisks in the
rendered text.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28 13:17:14 -08:00
Junio C Hamano
c524ceb12f Git 1.7.8.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.8.5
2012-02-26 16:40:20 -08:00
Michał Kiedrowicz
fba4f1259d grep -P: Fix matching ^ and $
When "git grep" is run with -P/--perl-regexp, it doesn't match ^ and $ at
the beginning/end of the line.  This is because PCRE normally matches ^
and $ at the beginning/end of the whole text, not for each line, and "git
grep" passes a large chunk of text (possibly containing many lines) to
pcre_exec() and then splits the text into lines.

This makes "git grep -P" behave differently from "git grep -E" and also
from "grep -P" and "pcregrep":

	$ cat file
	a
	 b
	$ git grep --no-index -P '^ ' file
	$ git grep --no-index -E '^ ' file
	file: b
	$ grep -c -P '^ ' file
	 b
	$ pcregrep -c '^ ' file
	 b

Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:34:03 -08:00
Jim Meyering
f0c5793b37 am: don't infloop for an empty input file
git-am.sh's check_patch_format function would attempt to preview
the patch to guess its format, but would go into an infinite loop
when the patch file happened to be empty.  The solution: exit the
loop when "read" fails, not when the line var, "$l1" becomes empty.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:32:54 -08:00
Andrew Wong
ad687b447a rebase -m: only call "notes copy" when rewritten exists and is non-empty
This prevents a shell error complaining rebase-merge/rewritten doesn't exist.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:32:37 -08:00
Dmitry V. Levin
39cb6445d9 Makefile: add thread-utils.h to LIB_H
Starting with commit v1.7.8-165-g0579f91, grep.h includes
thread-utils.h, so the latter has to be added to LIB_H.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 14:31:26 -08:00
Thomas Rast
8a557bb77f t5704: match tests to modern style
The test did not adhere to the current style on several counts:

 . empty lines around the test blocks, but within the test string
 . ': > file' or even just '> file' with an extra space
 . inconsistent indentation
 . hand-rolled commits instead of using test_commit

Fix all of them.

There's a catch to the last point: test_commit creates a tag, which the
original test did not create.  We still change it to test_commit, and
explicitly delete the tags, so as to highlight that the test relies on not
having them.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-23 13:53:27 -08:00
Thomas Rast
1c5f93b9a6 strbuf: improve strbuf_get*line documentation
Clarify strbuf_getline() documentation, and add the missing documentation
for strbuf_getwholeline() and strbuf_getwholeline_fd().

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-23 13:52:11 -08:00
Thomas Rast
bc2fed496b bundle: use a strbuf to scan the log for boundary commits
The first part of the bundle header contains the boundary commits, and
could be approximated by

  # v2 git bundle
  $(git rev-list --pretty=oneline --boundary <ARGS> | grep ^-)

git-bundle actually spawns exactly this rev-list invocation, and does
the grepping internally.

There was a subtle bug in the latter step: it used fgets() with a
1024-byte buffer.  If the user has sufficiently long subjects (e.g.,
by not adhering to the git oneline-subject convention in the first
place), the 'oneline' format can easily overflow the buffer.  fgets()
then returns the rest of the line in the next call(s).  If one of
these remaining parts started with '-', git-bundle would mistakenly
insert it into the bundle thinking it was a boundary commit.

Fix it by using strbuf_getwholeline() instead, which handles arbitrary
line lengths correctly.

Note that on the receiving side in parse_bundle_header() we were
already using strbuf_getwholeline_fd(), so that part is safe.

Reported-by: Jannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-23 09:36:44 -08:00
Thomas Rast
5e8617f560 bundle: put strbuf_readline_fd in strbuf.c with adjustments
The comment even said that it should eventually go there.  While at
it, match the calling convention and name of the function to the
strbuf_get*line family.  So it now is strbuf_getwholeline_fd.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 18:58:16 -08:00
Clemens Buchacher
d202a513a4 t5541: check error message against the real port number used
Otherwise the test cannot be run with custom port set to LIB_HTTPD_PORT.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-13 13:25:40 -08:00
Junio C Hamano
d0482e88a7 Sync with 1.7.6.6
* maint-1.7.7:
  Git 1.7.6.6
  imap-send: remove dead code
2012-02-05 23:52:53 -08:00
Junio C Hamano
110c511dbe Sync with 1.7.6.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-05 23:52:25 -08:00
Junio C Hamano
f174a2583c Git 1.7.6.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.6.6
2012-02-05 23:50:52 -08:00
Jeff King
28b22f8af9 imap-send: remove dead code
The imap-send code was adapted from another project, and
still contains many unused bits of code. One of these bits
contains a type "struct string_list" which bears no
resemblence to the "struct string_list" we use elsewhere in
git. This causes the compiler to complain if git's
string_list ever becomes part of cache.h.

Let's just drop the dead code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-05 23:44:56 -08:00
Kirill Smelkov
aae5239be2 t/Makefile: Use $(sort ...) explicitly where needed
Starting from GNU Make 3.82 $(wildcard ...) no longer sorts the result
(from NEWS):

    * WARNING: Backward-incompatibility!
      Wildcards were not documented as returning sorted values, but the results
      have been sorted up until this release..  If your makefiles require sorted
      results from wildcard expansions, use the $(sort ...)  function to request
      it explicitly.

    2a59dc32aa

I usually watch test progress visually, and if tests are sorted, even
with make -j4 they go more or less incrementally by their t number. On
the other side, without sorting, tests are executed in seemingly random
order even for -j1. Let's please maintain sane tests order for perceived
prettyness.

Another note is that in GNU Make sort also works as uniq, so after sort
being removed, we might expect e.g. $(wildcard *.sh a.*) to produce
duplicates for e.g. "a.sh". From this point of view, adding sort could
be seen as hardening t/Makefile from accidentally introduced dups.

It turned out that prevous releases of GNU Make did not perform full
sort in $(wildcard), only sorting results for each pattern, that's why
explicit sort-as-uniq is relevant even for older makes.

Signed-off-by: Kirill Smelkov <kirr@navytux.spb.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-22 14:55:16 -08:00
Shawn O. Pearce
5238cbf656 remote-curl: Fix push status report when all branches fail
The protocol between transport-helper.c and remote-curl requires
remote-curl to always print a blank line after the push command
has run. If the blank line is ommitted, transport-helper kills its
container process (the git push the user started) with exit(128)
and no message indicating a problem, assuming the helper already
printed reasonable error text to the console.

However if the remote rejects all branches with "ng" commands in the
report-status reply, send-pack terminates with non-zero status, and
in turn remote-curl exited with non-zero status before outputting
the blank line after the helper status printed by send-pack. No
error messages reach the user.

This caused users to see the following from git push over HTTP
when the remote side's update hook rejected the branch:

  $ git push http://... master
  Counting objects: 4, done.
  Delta compression using up to 6 threads.
  Compressing objects: 100% (2/2), done.
  Writing objects: 100% (3/3), 301 bytes, done.
  Total 3 (delta 0), reused 0 (delta 0)
  $

Always print a blank line after the send-pack process terminates,
ensuring the helper status report (if it was output) will be
correctly parsed by the calling transport-helper.c. This ensures
the helper doesn't abort before the status report can be shown to
the user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-20 10:14:32 -08:00
Junio C Hamano
c572f491e5 Git 1.7.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.8.4
2012-01-18 15:51:00 -08:00
Junio C Hamano
d899cf559b Merge branch 'maint-1.7.7' into maint
* maint-1.7.7:
  Git 1.7.7.6
  diff-index: enable recursive pathspec matching in unpack_trees

Conflicts:
	GIT-VERSION-GEN
2012-01-18 15:48:46 -08:00
Junio C Hamano
0065343548 Git 1.7.7.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.7.6
2012-01-18 15:46:31 -08:00
Nguyen Thai Ngoc Duy
5c8eeb83db diff-index: enable recursive pathspec matching in unpack_trees
The pathspec structure has a few bits of data to drive various operation
modes after we unified the pathspec matching logic in various codepaths.
For example, max_depth field is there so that "git grep" can limit the
output for files found in limited depth of tree traversal. Also in order
to show just the surface level differences in "git diff-tree", recursive
field stops us from descending into deeper level of the tree structure
when it is set to false, and this also affects pathspec matching when
we have wildcards in the pathspec.

The diff-index has always wanted the recursive behaviour, and wanted to
match pathspecs without any depth limit. But we forgot to do so when we
updated tree_entry_interesting() logic to unify the pathspec matching
logic.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-18 15:44:02 -08:00
Junio C Hamano
ab8a78084b Update draft release notes to 1.7.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12 23:33:29 -08:00
Junio C Hamano
5a6a939481 Merge branch 'maint-1.7.7' into maint
* maint-1.7.7:
  Update draft release notes to 1.7.7.6
  Update draft release notes to 1.7.6.6
  thin-pack: try harder to use preferred base objects as base
2012-01-12 23:31:46 -08:00
Junio C Hamano
8f83acf77c Update draft release notes to 1.7.7.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12 23:31:41 -08:00
Junio C Hamano
901c907d83 Merge branch 'maint-1.7.6' into maint-1.7.7
* maint-1.7.6:
  Update draft release notes to 1.7.6.6
  thin-pack: try harder to use preferred base objects as base
2012-01-12 23:31:05 -08:00
Junio C Hamano
04f6785a08 Update draft release notes to 1.7.6.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12 23:30:53 -08:00
Jeff King
15f07e061e thin-pack: try harder to use preferred base objects as base
When creating a pack using objects that reside in existing packs, we try
to avoid recomputing futile delta between an object (trg) and a candidate
for its base object (src) if they are stored in the same packfile, and trg
is not recorded as a delta already. This heuristics makes sense because it
is likely that we tried to express trg as a delta based on src but it did
not produce a good delta when we created the existing pack.

As the pack heuristics prefer producing delta to remove data, and Linus's
law dictates that the size of a file grows over time, we tend to record
the newest version of the file as inflated, and older ones as delta
against it.

When creating a thin-pack to transfer recent history, it is likely that we
will try to send an object that is recorded in full, as it is newer.  But
the heuristics to avoid recomputing futile delta effectively forbids us
from attempting to express such an object as a delta based on another
object. Sending an object in full is often more expensive than sending a
suboptimal delta based on other objects, and it is even more so if we
could use an object we know the receiving end already has (i.e. preferred
base object) as the delta base.

Tweak the recomputation avoidance logic, so that we do not punt on
computing delta against a preferred base object.

The effect of this change can be seen on two simulated upload-pack
workloads. The first is based on 44 reflog entries from my git.git
origin/master reflog, and represents the packs that kernel.org sent me git
updates for the past month or two. The second workload represents much
larger fetches, going from git's v1.0.0 tag to v1.1.0, then v1.1.0 to
v1.2.0, and so on.

The table below shows the average generated pack size and the average CPU
time consumed for each dataset, both before and after the patch:

                  dataset
            | reflog | tags
---------------------------------
     before | 53358  | 2750977
size  after | 32398  | 2668479
     change |   -39% |      -3%
---------------------------------
     before |  0.18  | 1.12
CPU   after |  0.18  | 1.15
     change |    +0% |      +3%

This patch makes a much bigger difference for packs with a shorter slice
of history (since its effect is seen at the boundaries of the pack) though
it has some benefit even for larger packs.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-12 23:06:20 -08:00
Junio C Hamano
113e828d38 Merge branch 'maint-1.7.7' into maint
* maint-1.7.7:
  attr: fix leak in free_attr_elem
  t2203: fix wrong commit command
2012-01-11 19:11:13 -08:00
Junio C Hamano
afb6b561e3 Merge branch 'maint-1.7.6' into maint-1.7.7
* maint-1.7.6:
  attr: fix leak in free_attr_elem
  t2203: fix wrong commit command
2012-01-11 19:11:00 -08:00
Jeff King
37475f97d1 attr: fix leak in free_attr_elem
This function frees the individual "struct match_attr"s we
have allocated, but forgot to free the array holding their
pointers, leading to a minor memory leak (but it can add up
after checking attributes for paths in many directories).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-11 19:07:23 -08:00
Nguyễn Thái Ngọc Duy
592ed5673e t2203: fix wrong commit command
Add commit message to avoid commit's aborting due to the lack of
commit message, not because there are INTENT_TO_ADD entries in index.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-11 00:09:36 -08:00
Junio C Hamano
be4d2920c2 Prepare for 1.7.8.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-10 14:27:14 -08:00
Junio C Hamano
55dcc2ebad Merge the attributes fix in from maint-1.6.7 branch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-01-10 14:24:01 -08:00