Commit Graph

24835 Commits

Author SHA1 Message Date
Junio C Hamano
54f6a8dbd6 Merge branch 'nd/index-doc'
* nd/index-doc:
  doc: technical details about the index file format
  doc: technical details about the index file format
2011-03-26 20:13:15 -07:00
Junio C Hamano
b3369abfeb Merge branch 'jc/fetch-progressive-stride'
* jc/fetch-progressive-stride:
  fetch-pack: use smaller handshake window for initial request
  fetch-pack: progressively use larger handshake windows
  fetch-pack: factor out hardcoded handshake window size

Conflicts:
	builtin/fetch-pack.c
2011-03-26 20:13:15 -07:00
Junio C Hamano
a080fdd1b1 Merge branch 'svn-fe' of git://repo.or.cz/git/jrn
* 'svn-fe' of git://repo.or.cz/git/jrn:
  vcs-svn: handle log message with embedded NUL
  vcs-svn: avoid unnecessary copying of log message and author
  vcs-svn: remove buffer_read_string
  vcs-svn: make reading of properties binary-safe
2011-03-26 11:35:41 -07:00
Junio C Hamano
42f9874573 Merge git-gui 0.14.0 2011-03-26 10:42:35 -07:00
Jonathan Nieder
195b7ca6f2 vcs-svn: handle log message with embedded NUL
Pass the log message by strbuf instead of as a C-style string and use
fwrite instead of printf to write it to fast-import so embedded '\0'
bytes can be preserved.

Currently "git log" doesn't show the embedded NULs but "git cat-file
commit" can.

While at it, stop including system headers from repo_tree.h.  git
source files need to include git-compat-util.h (or cache.h or
builtin.h) sooner to ensure the appropriate feature test macros are
defined.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-26 00:49:37 -05:00
Jonathan Nieder
4c3169b03e vcs-svn: avoid unnecessary copying of log message and author
Use strbuf_swap when storing the svn:log and svn:author properties, so
pointers to rather than the contents of buffers get copied.  The main
effect should be to make the code a little easier to read.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-26 00:41:38 -05:00
Jonathan Nieder
7e2fe3a9fc vcs-svn: remove buffer_read_string
All previous users of buffer_read_string have already been converted
to use the more intuitive buffer_read_binary, so remove the old API to
avoid some confusion.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-26 00:17:35 -05:00
Jonathan Nieder
e7d04ee147 vcs-svn: make reading of properties binary-safe
svn-fe errors out on revision 59151 of the ASF repository:

 fatal: invalid dump: unexpected end of file

The proximate cause is a property with an embedded NUL character.
Previously such anomalies were ignored but commit c9d1c8ba
(2010-12-28) introduced a check strlen(val) == len to avoid reading
uninitialized data when a property list ends early and unfortunately
this test does not distinguish between "foo" followed by EOF and the
string "foo\0bar\0baz".

Fix it by using buffer_read_binary to read to a strbuf and checking
the actual length read.  Most consumers of properties still use
C-style strings, so in practice an author or log message with embedded
NULs will be truncated, but a least this way svn-fe won't error out
(fixing the regression).

Reported-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-26 00:15:10 -05:00
Junio C Hamano
421446b6fc Sync with 1.7.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 17:57:08 -07:00
Junio C Hamano
78bc466753 Git 1.7.4.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 17:56:14 -07:00
Jeff King
d6d9e76d7f t7607: clean up stray untracked file
This file ends up conflicting with the test just after it
(causing the "git merge" to fail).  Neither test is to blame
for the bug, though. It looks like the merge in 1a9fe45
(Merge branch 'tr/merge-unborn-clobber', 2011-02-09) is what
caused the conflict.

We didn't notice because the follow-on test is already
marked as expect_failure (even though it has since been
fixed, and now succeeds once the untracked file is moved out
of the way).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 14:13:57 -07:00
Jeff King
8523d071ad t7607: mark known breakage in test 11 as fixed
This was fixed by 1d718a51 (do not overwrite untracked
symlinks, 2011-02-20).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 14:12:00 -07:00
Jakub Narebski
2b1e17237b gitweb: Fix handling of fractional timezones in parse_date
Fractional timezones, like -0330 (NST used in Canada) or +0430
(Afghanistan, Iran DST), were not handled properly in parse_date; this
means values such as 'minute_local' and 'iso-tz' were not generated
correctly.

This was caused by two mistakes:

* sign of timezone was applied only to hour part of offset, and not
  as it should be also to minutes part (this affected only negative
  fractional timezones).

* 'int $h + $m/60' is 'int($h + $m/60)' and not 'int($h) + $m/60',
  so fractional part was discarded altogether ($h is hours, $m is
  minutes, which is always less than 60).

Note that positive fractional timezones +0430, +0530 and +1030 can be
found as authortime in git.git repository itself.

For example http://repo.or.cz/w/git.git/commit/88d50e7 had authortime
of "Fri, 8 Jan 2010 18:48:07 +0000 (23:48 +0530)", which is not marked
with 'atnight', when "git show 88d50e7" gives correct author date of
"Sat Jan 9 00:18:07 2010 +0530".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 13:27:05 -07:00
Pat Thoyts
fbc9629e2f Merge branch 'ss/git-gui-mergetool' 2011-03-25 08:26:47 +00:00
Pat Thoyts
35b6f72feb git-gui: detect the use of MUI langauge packs on Windows
The Tcl msgcat package doesn't detect the use of a multi-lingual language
pack on Windows 7. This means that a user may have their display language
set to Japanese but the system installed langauge was English.
This patch reads the relevent registry key to fix this before loading in
the locale specific parts of git-gui.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2011-03-25 08:26:31 +00:00
Junio C Hamano
23fcc98f7f doc: technical details about the index file format
* Clarify "string of unsigned bytes";

 * Blob has two variants (regular file vs symlink), not (blob vs symlink);

 * Clarify permission mode bits;

 * Clarify ce_namelen() "too long to fit in the length field" case;

 * Clarify "." etc are forbidden as path components;

 * Match the description with the internal wording "cache-tree";

 * All types of extension begin with signature and length as explained in
   the first part. Don't repeat the "length" part in the description of
   each extension (can be mistaken as if there is a separate 32-bit size
   field inside the extension), but state what the signature for each
   extension is.

 * Don't say "Extension tag", as we have said "Extension signature" in the
   first part---be consistent;

 * Clarify the invalidation of cache-tree entries;

 * Correct description on subtree_nr field in the cache-tree;

 * Clarify the order of entries in cache-tree;

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-23 15:57:10 -07:00
Junio C Hamano
cd3065f9e3 Merge branch 'kc/gitweb-pathinfo-w-anchor'
* kc/gitweb-pathinfo-w-anchor:
  gitweb: fix #patchNN anchors when path_info is enabled
2011-03-23 14:55:55 -07:00
Junio C Hamano
eec3bd44d8 Merge branch 'jn/fortify-source-workaround'
* jn/fortify-source-workaround:
  run-command: prettify -D_FORTIFY_SOURCE workaround
2011-03-23 14:55:49 -07:00
Junio C Hamano
3ed8868474 Merge branch 'jn/maint-c99-format'
* jn/maint-c99-format:
  unbreak and eliminate NO_C99_FORMAT
  mktag: avoid %td in format string
2011-03-23 14:55:46 -07:00
Junio C Hamano
da2584243e Merge branch 'lt/default-abbrev'
* lt/default-abbrev:
  Rename core.abbrevlength back to core.abbrev
  Make the default abbrev length configurable
2011-03-23 14:55:40 -07:00
Junio C Hamano
6fe519a91c Merge branch 'pk/stash-apply-status-relative'
* pk/stash-apply-status-relative:
  Add test: git stash shows status relative to current dir
  git stash: show status relative to current directory
2011-03-23 14:55:37 -07:00
Junio C Hamano
7d0cf357a3 Merge branch 'jc/maint-diff-q-filter'
* jc/maint-diff-q-filter:
  diff --quiet: disable optimization when --diff-filter=X is used
2011-03-23 14:55:17 -07:00
Junio C Hamano
98b256bd08 Merge branch 'pw/p4'
* pw/p4:
  git-p4: test sync new branch
  git-p4: fix sync new branch regression
2011-03-23 14:54:24 -07:00
Junio C Hamano
5e839c8f6d Update draft release notes to 1.7.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-22 22:02:24 -07:00
Junio C Hamano
aeb2aaa771 Merge branch 'mg/rev-list-one-side-only'
* mg/rev-list-one-side-only:
  git-log: put space after commit mark
  t6007: test rev-list --cherry
  log --cherry: a synonym
  rev-list: documentation and test for --cherry-mark
  revision.c: introduce --cherry-mark
  rev-list/log: factor out revision mark generation
  rev-list: --left/right-only are mutually exclusive
  rev-list: documentation and test for --left/right-only
  t6007: Make sure we test --cherry-pick
  revlist.c: introduce --left/right-only for unsymmetric picking
2011-03-22 21:38:50 -07:00
Junio C Hamano
281ee1d0c2 Merge branch 'js/maint-stash-index-copy'
* js/maint-stash-index-copy:
  stash: copy the index using --index-output instead of cp -p
  stash: fix incorrect quoting in cleanup of temporary files
2011-03-22 21:38:25 -07:00
Junio C Hamano
f9249ecfa9 Merge branch 'tl/p4'
* tl/p4:
  git-p4: Fix error message crash in P4Sync.commit.
  Teach git-p4 to ignore case in perforce filenames if configured.
  git-p4: Teach gitConfig method about arguments.
2011-03-22 21:38:19 -07:00
Junio C Hamano
b350f7797c Merge branch 'mg/doc-bisect-tweak-worktree'
* mg/doc-bisect-tweak-worktree:
  git-bisect.txt: example for bisecting with hot-fix
  git-bisect.txt: streamline run presentation
2011-03-22 21:38:15 -07:00
Junio C Hamano
50aaeca008 Merge branch 'jn/test-sanitize-git-env'
* jn/test-sanitize-git-env:
  tests: scrub environment of GIT_* variables
  config: drop support for GIT_CONFIG_NOGLOBAL
  gitattributes: drop support for GIT_ATTR_NOGLOBAL
  tests: suppress system gitattributes
  tests: stop worrying about obsolete environment variables
2011-03-22 21:38:12 -07:00
Junio C Hamano
f59bf09678 Merge branch 'sp/maint-upload-pack-stop-early'
* sp/maint-upload-pack-stop-early:
  upload-pack: Implement no-done capability
  upload-pack: More aggressively send 'ACK %s ready'
2011-03-22 21:38:06 -07:00
Junio C Hamano
1c6a50bb41 Merge branch 'sp/maint-fetch-pack-stop-early'
* sp/maint-fetch-pack-stop-early:
  fetch-pack: Implement no-done capability
  fetch-pack: Finish negotation if remote replies "ACK %s ready"
2011-03-22 21:38:03 -07:00
Junio C Hamano
4b28cd9f2f Merge branch 'jc/maint-rev-list-culled-boundary'
* jc/maint-rev-list-culled-boundary:
  list-objects.c: don't add an unparsed NULL as a pending tree

Conflicts:
	list-objects.c
2011-03-22 21:37:59 -07:00
Junio C Hamano
91b3c7ce8e Merge branch 'jc/maint-fetch-alt'
* jc/maint-fetch-alt:
  fetch-pack: objects in our alternates are available to us
  refs_from_alternate: helper to use refs from alternates

Conflicts:
	builtin/receive-pack.c
2011-03-22 21:37:53 -07:00
Junio C Hamano
1c92e39446 Merge branch 'sg/complete-symmetric-diff'
* sg/complete-symmetric-diff:
  bash: complete 'git diff ...branc<TAB>'
  bash: fix misindented esac statement in __git_complete_file()
2011-03-22 21:37:47 -07:00
Junio C Hamano
785d6989da Merge branch 'svn-fe' of git://repo.or.cz/git/jrn
* 'svn-fe' of git://repo.or.cz/git/jrn:
  vcs-svn: use strchr to find RFC822 delimiter
  vcs-svn: implement perfect hash for top-level keys
  vcs-svn: implement perfect hash for node-prop keys
  vcs-svn: use strbuf for author, UUID, and URL
  vcs-svn: use strbuf for revision log
  vcs-svn: improve reporting of input errors
  vcs-svn: make buffer_copy_bytes return length read
  vcs-svn: make buffer_skip_bytes return length read
  vcs-svn: improve support for reading large files
  vcs-svn: allow input errors to be detected promptly
  vcs-svn: simplify repo_modify_path and repo_copy
  vcs-svn: handle_node: use repo_read_path
  vcs-svn: introduce repo_read_path to check the content at a path
2011-03-22 20:51:07 -07:00
Jonathan Nieder
41b9dd9d4f Merge branch 'db/length-as-hash' into svn-fe
* db/length-as-hash:
  vcs-svn: use strchr to find RFC822 delimiter
  vcs-svn: implement perfect hash for top-level keys
  vcs-svn: implement perfect hash for node-prop keys

Conflicts:
	vcs-svn/svndump.c
2011-03-22 18:44:49 -05:00
David Barr
f1602054e3 vcs-svn: use strchr to find RFC822 delimiter
This is a small optimisation (4% reduction in user time) but is the
largest artifact within the parsing portion of svndump.c

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 18:09:05 -05:00
David Barr
90c0a3cfe3 vcs-svn: implement perfect hash for top-level keys
Instead of interning property names and comparing their string_pool
keys, look them up in a table by string length, which should be about
as fast.

Another small step towards removing dependence on string_pool
altogether.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 18:09:05 -05:00
David Barr
044ad2906a vcs-svn: implement perfect hash for node-prop keys
Instead of interning property names and comparing their string_pool
keys, look them up in a table by string length, which should be about
as fast.

This is a small step towards removing dependence on string_pool.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 18:09:02 -05:00
David Barr
7c5817d3ba vcs-svn: use strbuf for author, UUID, and URL
Use strbufs and strings instead of interned strings for values of rev,
dump, and node fields that happen to be strings.  After this change,
the only remaining string_pool use is for paths in the repo_tree API
and internals.

Functional change: treat an empty author, UUID, or URL as none at all.
So for example, in repos where the first revision has an empty
svn:author property, the first rev will be treated as by "nobody"
rather than by a person with empty name and email address created by
prepending an @ sign to the repository UUID.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 18:01:48 -05:00
Junio C Hamano
1ea9f9d6c2 Merge branch 'maint'
* maint:
  git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply'
  bisect: visualize with git-log if gitk is unavailable
2011-03-22 14:56:13 -07:00
David Barr
dce33c9c18 vcs-svn: use strbuf for revision log
obj_pool is overkill for this application: all that is needed is a
buffer that can resize from rev to rev to accomodate differently-sized
strings.  In the spirit of commit deadcef4 (2010-11-06), use a strbuf
instead.

This is a small step towards removing dependence on obj_pool.h.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 16:41:36 -05:00
Jonathan Nieder
c9d1c8ba05 vcs-svn: improve reporting of input errors
Catch input errors and exit early enough to print a reasonable
diagnosis based on errno.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 16:41:09 -05:00
Jonathan Nieder
26557fc1b3 vcs-svn: make buffer_copy_bytes return length read
Currently buffer_copy_bytes does not report to its caller whether
it encountered an early end of file.

Add a return value representing the number of bytes read (but not
the number of bytes copied).  This way all three unusual conditions
can be distinguished: input error with buffer_ferror, output error
with ferror(outfile), early end of input by checking the return
value.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 16:40:26 -05:00
Jonathan Nieder
d234f54b2f vcs-svn: make buffer_skip_bytes return length read
Currently there is no way to detect when input ended if it ended
early during buffer_skip_bytes.  Tell the calling program how many
bytes were actually skipped for easier debugging.

Existing callers will still ignore early EOF.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 16:39:54 -05:00
Jonathan Nieder
93b709c79e vcs-svn: improve support for reading large files
Move from uint32_t to off_t as the fundamental unit of length used by
the line_buffer library.  Performance would get worse if anything but
I think it's worth it for support of deltas that need to skip large
pieces (> 4 GiB).

Exception: buffer_read_string still takes a uint32_t, since it keeps
its result in an in-core obj_pool.

Callers still have to be updated to take advantage of this.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
2011-03-22 16:32:09 -05:00
SZEDER Gábor
b5f306fbe1 git-am.txt: advertise 'git am --abort' instead of 'rm .git/rebase-apply'
'git am --abort' is around for quite a long time now, and users should
normally not poke around inside the .git directory, yet the
documentation of 'git am' still recommends the following:

  ... if you decide to start over from scratch,
  run `rm -f -r .git/rebase-apply` ...

Suggest 'git am --abort' instead.

It's not quite the same as the original, because 'git am --abort' will
restore the original branch, while simply removing '.git/rebase-apply'
won't, but that's rather a thinko in the original wording, because
that won't actually "start over _from scratch_".

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-22 14:31:21 -07:00
Stephen Boyd
c2e86addb8 Fix sparse warnings
Fix warnings from 'make check'.

 - These files don't include 'builtin.h' causing sparse to complain that
   cmd_* isn't declared:

   builtin/clone.c:364, builtin/fetch-pack.c:797,
   builtin/fmt-merge-msg.c:34, builtin/hash-object.c:78,
   builtin/merge-index.c:69, builtin/merge-recursive.c:22
   builtin/merge-tree.c:341, builtin/mktag.c:156, builtin/notes.c:426
   builtin/notes.c:822, builtin/pack-redundant.c:596,
   builtin/pack-refs.c:10, builtin/patch-id.c:60, builtin/patch-id.c:149,
   builtin/remote.c:1512, builtin/remote-ext.c:240,
   builtin/remote-fd.c:53, builtin/reset.c:236, builtin/send-pack.c:384,
   builtin/unpack-file.c:25, builtin/var.c:75

 - These files have symbols which should be marked static since they're
   only file scope:

   submodule.c:12, diff.c:631, replace_object.c:92, submodule.c:13,
   submodule.c:14, trace.c:78, transport.c:195, transport-helper.c:79,
   unpack-trees.c:19, url.c:3, url.c:18, url.c:104, url.c:117, url.c:123,
   url.c:129, url.c:136, thread-utils.c:21, thread-utils.c:48

 - These files redeclare symbols to be different types:

   builtin/index-pack.c:210, parse-options.c:564, parse-options.c:571,
   usage.c:49, usage.c:58, usage.c:63, usage.c:72

 - These files use a literal integer 0 when they really should use a NULL
   pointer:

   daemon.c:663, fast-import.c:2942, imap-send.c:1072, notes-merge.c:362

While we're in the area, clean up some unused #includes in builtin files
(mostly exec_cmd.h).

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-22 10:16:54 -07:00
Jeff King
c4e4644e17 bisect: visualize with git-log if gitk is unavailable
If gitk is not available in the PATH, bisect ends up
exiting with the shell's 127 error code, confusing the git
wrapper into thinking that bisect is not a git command.

We already fallback to git-log if there doesn't seem to be a
graphical display available. We should do the same if gitk
is not available in our PATH at all. This not only fixes the
ugly error message, but is a much more sensible default than
failing to show the user anything.

Reported by Maxin John.

Tested-by: Maxin B. John <maxin@maxinbjohn.info>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-21 10:23:45 -07:00
Junio C Hamano
a71f09fe3e Rename core.abbrevlength back to core.abbrev
It corresponds to --abbrev=$n command line option after all.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-20 22:26:24 -07:00