Code

git.git
13 years agoMerge branch 'lt/rename-no-extra-copy-detection'
Junio C Hamano [Fri, 4 Mar 2011 23:02:27 +0000 (15:02 -0800)]
Merge branch 'lt/rename-no-extra-copy-detection'

* lt/rename-no-extra-copy-detection:
  diffcore-rename: improve estimate_similarity() heuristics
  diffcore-rename: properly honor the difference between -M and -C
  for_each_hash: allow passing a 'void *data' pointer to callback

13 years agoMerge branch 'jn/test-terminal-punt-on-osx-breakage'
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jn/test-terminal-punt-on-osx-breakage'

* jn/test-terminal-punt-on-osx-breakage:
  tests: skip terminal output tests on OS X

13 years agoMerge branch 'jk/fail-null-clone'
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jk/fail-null-clone'

* jk/fail-null-clone:
  clone: die when trying to clone missing local path

13 years agoMerge branch 'jc/grep--no-index-pathspec-fix'
Junio C Hamano [Fri, 4 Mar 2011 23:02:26 +0000 (15:02 -0800)]
Merge branch 'jc/grep--no-index-pathspec-fix'

* jc/grep--no-index-pathspec-fix:
  grep --no-index: honor pathspecs correctly

13 years agoMerge branch 'maint'
Junio C Hamano [Wed, 2 Mar 2011 23:26:44 +0000 (15:26 -0800)]
Merge branch 'maint'

* maint:
  verify-pack: add --stat-only to the synopsis section

13 years agoverify-pack: add --stat-only to the synopsis section
Junio C Hamano [Tue, 1 Mar 2011 19:26:22 +0000 (11:26 -0800)]
verify-pack: add --stat-only to the synopsis section

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'svn-fe' of git://repo.or.cz/git/jrn
Junio C Hamano [Tue, 1 Mar 2011 00:33:45 +0000 (16:33 -0800)]
Merge branch 'svn-fe' of git://repo.or.cz/git/jrn

* 'svn-fe' of git://repo.or.cz/git/jrn: (31 commits)
  fast-import: make code "-Wpointer-arith" clean
  vcs-svn: teach line_buffer about temporary files
  vcs-svn: allow input from file descriptor
  vcs-svn: allow character-oriented input
  vcs-svn: add binary-safe read function
  t0081 (line-buffer): add buffering tests
  vcs-svn: tweak test-line-buffer to not assume line-oriented input
  tests: give vcs-svn/line_buffer its own test script
  vcs-svn: make test-line-buffer input format more flexible
  vcs-svn: teach line_buffer to handle multiple input files
  vcs-svn: collect line_buffer data in a struct
  vcs-svn: replace buffer_read_string memory pool with a strbuf
  vcs-svn: eliminate global byte_buffer
  fast-import: add 'ls' command
  vcs-svn: Allow change nodes for root of tree (/)
  vcs-svn: Implement Prop-delta handling
  vcs-svn: Sharpen parsing of property lines
  vcs-svn: Split off function for handling of individual properties
  vcs-svn: Make source easier to read on small screens
  vcs-svn: More dump format sanity checks
  ...

13 years agofast-import: make code "-Wpointer-arith" clean
Jonathan Nieder [Mon, 28 Feb 2011 21:16:59 +0000 (15:16 -0600)]
fast-import: make code "-Wpointer-arith" clean

The dereference() function to peel a tree-ish and find the underlying
tree expects arithmetic to (void *) to work on byte addresses.  We
should be reading the text of objects through a char * anyway.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agoStart preparing release notes to 1.7.5
Junio C Hamano [Mon, 28 Feb 2011 20:28:20 +0000 (12:28 -0800)]
Start preparing release notes to 1.7.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jh/push-default-upstream-configname'
Junio C Hamano [Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)]
Merge branch 'jh/push-default-upstream-configname'

* jh/push-default-upstream-configname:
  push.default: Rename 'tracking' to 'upstream'

13 years agoMerge branch 'lp/config-vername-check'
Junio C Hamano [Mon, 28 Feb 2011 05:58:31 +0000 (21:58 -0800)]
Merge branch 'lp/config-vername-check'

* lp/config-vername-check:
  Disallow empty section and variable names
  Sanity-check config variable names

13 years agoMerge branch 'mg/placeholders-are-lowercase'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mg/placeholders-are-lowercase'

* mg/placeholders-are-lowercase:
  Make <identifier> lowercase in Documentation
  Make <identifier> lowercase as per CodingGuidelines
  Make <identifier> lowercase as per CodingGuidelines
  Make <identifier> lowercase as per CodingGuidelines
  CodingGuidelines: downcase placeholders in usage messages

13 years agoMerge branch 'mg/patch-id'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mg/patch-id'

* mg/patch-id:
  git-patch-id: do not trip over "no newline" markers
  git-patch-id: test for "no newline" markers

13 years agoMerge branch 'mz/rerere-remaining'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'mz/rerere-remaining'

* mz/rerere-remaining:
  mergetool: don't skip modify/remove conflicts
  rerere "remaining"

13 years agoMerge branch 'nd/sorted-builtin-command-list'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'nd/sorted-builtin-command-list'

* nd/sorted-builtin-command-list:
  git.c: reorder builtin command list

13 years agoMerge branch 'js/maint-merge-use-prepare-commit-msg-hook'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'js/maint-merge-use-prepare-commit-msg-hook'

* js/maint-merge-use-prepare-commit-msg-hook:
  merge: honor prepare-commit-msg hook

13 years agoMerge branch 'nd/hash-object-sanity'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'nd/hash-object-sanity'

* nd/hash-object-sanity:
  Make hash-object more robust against malformed objects

Conflicts:
cache.h

13 years agoMerge branch 'js/detach-doc'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'js/detach-doc'

* js/detach-doc:
  git-checkout.txt: improve detached HEAD documentation

13 years agoMerge branch 'va/p4'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'va/p4'

* va/p4:
  git-p4: Add copy detection support
  git-p4: Improve rename detection support

13 years agoMerge branch 'pw/p4'
Junio C Hamano [Mon, 28 Feb 2011 05:58:30 +0000 (21:58 -0800)]
Merge branch 'pw/p4'

* pw/p4:
  git-p4: support clone --bare
  git-p4: decode p4 wildcard characters
  git-p4: better message for "git-p4 sync" when not cloned
  git-p4: reinterpret confusing p4 message
  git-p4: accommodate new move/delete type in p4
  git-p4: add missing newline in initial import message
  git-p4: fix key error for p4 problem
  git-p4: test script

13 years agoMerge branch 'uk/checkout-ambiguous-ref'
Junio C Hamano [Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)]
Merge branch 'uk/checkout-ambiguous-ref'

* uk/checkout-ambiguous-ref:
  Rename t2019 with typo "amiguous" that meant "ambiguous"
  checkout: rearrange update_refs_for_switch for clarity
  checkout: introduce --detach synonym for "git checkout foo^{commit}"
  checkout: split off a function to peel away branchname arg
  checkout: fix bug with ambiguous refs

Conflicts:
builtin/checkout.c

13 years agoMerge branch 'sp/maint-smart-http-sans-100-continue'
Junio C Hamano [Mon, 28 Feb 2011 05:58:29 +0000 (21:58 -0800)]
Merge branch 'sp/maint-smart-http-sans-100-continue'

* sp/maint-smart-http-sans-100-continue:
  smart-http: Don't use Expect: 100-Continue

13 years agoMerge branch 'mo/perl-bidi-pipe-envfix'
Junio C Hamano [Mon, 28 Feb 2011 05:58:28 +0000 (21:58 -0800)]
Merge branch 'mo/perl-bidi-pipe-envfix'

* mo/perl-bidi-pipe-envfix:
  perl: command_bidi_pipe() method should set-up git environmens

13 years agoMerge branch 'hv/mingw-fs-funnies'
Junio C Hamano [Mon, 28 Feb 2011 05:17:37 +0000 (21:17 -0800)]
Merge branch 'hv/mingw-fs-funnies'

* hv/mingw-fs-funnies:
  mingw_rmdir: set errno=ENOTEMPTY when appropriate
  mingw: add fallback for rmdir in case directory is in use
  mingw: make failures to unlink or move raise a question
  mingw: work around irregular failures of unlink on windows
  mingw: move unlink wrapper to mingw.c

13 years agoMerge branch 'en/object-list-with-pathspec'
Junio C Hamano [Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)]
Merge branch 'en/object-list-with-pathspec'

* en/object-list-with-pathspec:
  Add testcases showing how pathspecs are handled with rev-list --objects
  Make rev-list --objects work together with pathspecs

13 years agoMerge branch 'nd/struct-pathspec'
Junio C Hamano [Mon, 28 Feb 2011 05:17:36 +0000 (21:17 -0800)]
Merge branch 'nd/struct-pathspec'

* nd/struct-pathspec: (22 commits)
  t6004: add pathspec globbing test for log family
  t7810: overlapping pathspecs and depth limit
  grep: drop pathspec_matches() in favor of tree_entry_interesting()
  grep: use writable strbuf from caller for grep_tree()
  grep: use match_pathspec_depth() for cache/worktree grepping
  grep: convert to use struct pathspec
  Convert ce_path_match() to use match_pathspec_depth()
  Convert ce_path_match() to use struct pathspec
  struct rev_info: convert prune_data to struct pathspec
  pathspec: add match_pathspec_depth()
  tree_entry_interesting(): optimize wildcard matching when base is matched
  tree_entry_interesting(): support wildcard matching
  tree_entry_interesting(): fix depth limit with overlapping pathspecs
  tree_entry_interesting(): support depth limit
  tree_entry_interesting(): refactor into separate smaller functions
  diff-tree: convert base+baselen to writable strbuf
  glossary: define pathspec
  Move tree_entry_interesting() to tree-walk.c and export it
  tree_entry_interesting(): remove dependency on struct diff_options
  Convert struct diff_options to use struct pathspec
  ...

13 years agogitweb: Make i18n (encoding) tests in t9500 leave clean state
Jakub Narebski [Sun, 27 Feb 2011 16:58:32 +0000 (17:58 +0100)]
gitweb: Make i18n (encoding) tests in t9500 leave clean state

The most important issue is that after unsetting `i18n.commitencoding'
config variable t9500 no longer will use author and comitter name
containing ISO-8859-1 characters, which are invalid UTF-8 characters.

Besides it is good practice in general to clean up the state in tests.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-add: make -A description clearer vs. -u
Michael J Gruber [Sun, 27 Feb 2011 15:50:10 +0000 (16:50 +0100)]
git-add: make -A description clearer vs. -u

Currently, it sounds as if "notice removal of files" distinguishes "-A"
from "-u", and there is no mention of the worktree.

But both notice the removal, and only "-A" adds changes from untracked
files. Say so.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Sun, 27 Feb 2011 08:52:15 +0000 (00:52 -0800)]
Merge branch 'maint'

* maint:
  branch_merged: fix grammar in warning

13 years agobranch_merged: fix grammar in warning
Eric Hanchrow [Sat, 26 Feb 2011 03:29:42 +0000 (19:29 -0800)]
branch_merged: fix grammar in warning

Signed-off-by: Eric Hanchrow <eric.hanchrow@gmail.com>
Helped-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge commit 'jn/svn-fe' of git://github.com/gitster/git into svn-fe
Jonathan Nieder [Sat, 26 Feb 2011 11:21:29 +0000 (05:21 -0600)]
Merge commit 'jn/svn-fe' of git://github.com/gitster/git into svn-fe

* git://github.com/gitster/git:
  vcs-svn: Allow change nodes for root of tree (/)
  vcs-svn: Implement Prop-delta handling
  vcs-svn: Sharpen parsing of property lines
  vcs-svn: Split off function for handling of individual properties
  vcs-svn: Make source easier to read on small screens
  vcs-svn: More dump format sanity checks
  vcs-svn: Reject path nodes without Node-action
  vcs-svn: Delay read of per-path properties
  vcs-svn: Combine repo_replace and repo_modify functions
  vcs-svn: Replace = Delete + Add
  vcs-svn: handle_node: Handle deletion case early
  vcs-svn: Use mark to indicate nodes with included text
  vcs-svn: Unclutter handle_node by introducing have_props var
  vcs-svn: Eliminate node_ctx.mark global
  vcs-svn: Eliminate node_ctx.srcRev global
  vcs-svn: Check for errors from open()
  vcs-svn: Allow simple v3 dumps (no deltas yet)

Conflicts:
t/t9010-svn-fe.sh
vcs-svn/svndump.c

13 years agovcs-svn: teach line_buffer about temporary files
Jonathan Nieder [Mon, 3 Jan 2011 03:10:59 +0000 (21:10 -0600)]
vcs-svn: teach line_buffer about temporary files

It can sometimes be useful to write information temporarily to file,
to read back later.  These functions allow a program to use the
line_buffer facilities when doing so.

It works like this:

 1. find a unique filename with buffer_tmpfile_init.
 2. rewind with buffer_tmpfile_rewind.  This returns a stdio
    handle for writing.
 3. when finished writing, declare so with
    buffer_tmpfile_prepare_to_read.  The return value indicates
    how many bytes were written.
 4. read whatever portion of the file is needed.
 5. if finished, remove the temporary file with buffer_deinit.
    otherwise, go back to step 2,

The svn support would use this to buffer the postimage from delta
application until the length is known and fast-import can receive
the resulting blob.

Based-on-patch-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: allow input from file descriptor
Jonathan Nieder [Mon, 3 Jan 2011 03:09:38 +0000 (21:09 -0600)]
vcs-svn: allow input from file descriptor

Based-on-patch-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: allow character-oriented input
Jonathan Nieder [Mon, 3 Jan 2011 03:06:32 +0000 (21:06 -0600)]
vcs-svn: allow character-oriented input

buffer_read_char can be used in place of buffer_read_string(1) to
avoid consuming valuable static buffer space.  The delta applier will
use this to read variable-length integers one byte at a time.

Underneath, it is fgetc, wrapped so the line_buffer library can
maintain its role as gatekeeper of input.

Later it might be worth checking if fgetc_unlocked is faster ---
most line_buffer functions are not thread-safe anyway.

Helpd-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: add binary-safe read function
Jonathan Nieder [Mon, 3 Jan 2011 03:05:46 +0000 (21:05 -0600)]
vcs-svn: add binary-safe read function

buffer_read_string works well for non line-oriented input except for
one problem: it does not tell the caller how many bytes were actually
written.  This means that unless one is very careful about checking
for errors (and eof) the calling program cannot tell the difference
between the string "foo" followed by an early end of file and the
string "foo\0bar\0baz".

So introduce a variant that reports the length, too, a thinner wrapper
around strbuf_fread.  Its result is written to a strbuf so the caller
does not need to keep track of the number of bytes read.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agot0081 (line-buffer): add buffering tests
Jonathan Nieder [Mon, 3 Jan 2011 01:07:16 +0000 (19:07 -0600)]
t0081 (line-buffer): add buffering tests

POSIX makes the behavior of read(2) from a pipe fairly clear: a read
from an empty pipe will block until there is data available and any
other read will not block, prefering to return a partial result.
Likewise, fread(3) and fgets(3) are clearly specified to act as
though implemented by calling fgetc(3) in a simple loop.  But the
buffering behavior of fgetc is less clear.

Luckily, no sane platform is going to implement fgetc by calling the
equivalent of read(2) more than once.  fgetc has to be able to
return without filling its buffer to preserve errno when errors are
encountered anyway.  So let's assume the simpler behavior (trust) but
add some tests to catch insane platforms that violate that when they
come (verify).

First check that fread can handle a 0-length read from an empty fifo.
Because open(O_RDONLY) blocks until the writing end is open, open the
writing end of the fifo in advance in a subshell.

Next try short inputs from a pipe that is not filled all the way.

Lastly (two tests) try very large inputs from a pipe that will not fit
in the relevant buffers.  The first of these tests reads a little
more than 8192 bytes, which is BUFSIZ (the size of stdio's buffers)
on this Linux machine.  The second reads a little over 64 KiB (the
pipe capacity on Linux) and is not run unless requested by setting
the GIT_REMOTE_SVN_TEST_BIG_FILES environment variable.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: tweak test-line-buffer to not assume line-oriented input
Jonathan Nieder [Mon, 3 Jan 2011 00:52:28 +0000 (18:52 -0600)]
vcs-svn: tweak test-line-buffer to not assume line-oriented input

Do not expect an implicit newline after each input record.
Use a separate command to exercise buffer_skip_bytes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agotests: give vcs-svn/line_buffer its own test script
Jonathan Nieder [Mon, 3 Jan 2011 00:51:07 +0000 (18:51 -0600)]
tests: give vcs-svn/line_buffer its own test script

Split the line_buffer test into small pieces and move it to its
own file as preparation for adding more tests.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: make test-line-buffer input format more flexible
Jonathan Nieder [Mon, 3 Jan 2011 00:50:16 +0000 (18:50 -0600)]
vcs-svn: make test-line-buffer input format more flexible

Imitate the input format of test-obj-pool to support arbitrary
sequences of commands rather than alternating read/copy.  This should
make it easier to add tests that exercise other line_buffer functions.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: teach line_buffer to handle multiple input files
Jonathan Nieder [Mon, 11 Oct 2010 02:41:06 +0000 (21:41 -0500)]
vcs-svn: teach line_buffer to handle multiple input files

Collect the line_buffer state in a newly public line_buffer struct.
Callers can use multiple line_buffers to manage input from multiple
files at a time.

svn-fe's delta applier will use this to stream a delta from svnrdump
and the preimage it applies to from fast-import at the same time.

The tests don't take advantage of the new features, but I think that's
okay.  It is easier to find lingering examples of nonreentrant code by
searching for "static" in line_buffer.c.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: collect line_buffer data in a struct
Jonathan Nieder [Mon, 11 Oct 2010 02:39:21 +0000 (21:39 -0500)]
vcs-svn: collect line_buffer data in a struct

Prepare for the line_buffer lib to support input from multiple files,
by collecting global state in a struct that can be easily passed
around.

No API change yet.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: replace buffer_read_string memory pool with a strbuf
Jonathan Nieder [Sat, 6 Nov 2010 17:01:28 +0000 (12:01 -0500)]
vcs-svn: replace buffer_read_string memory pool with a strbuf

obj_pool is inherently global and does not use the standard growing
factor alloc_nr, which makes it feel out of place in the git codebase.
Plus it is overkill for this application: all that is needed is a
buffer that can grow between requests to accomodate larger strings.
Use a strbuf instead.

As a side effect, this improves the error handling: allocation
failures will result in a clean exit instead of segfaults.  It would
be nice to add a test case (using ulimit or failmalloc) but that can
wait for another day.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agovcs-svn: eliminate global byte_buffer
Jonathan Nieder [Mon, 11 Oct 2010 02:37:10 +0000 (21:37 -0500)]
vcs-svn: eliminate global byte_buffer

The data stored in byte_buffer[] is always either discarded or
written to stdout immediately.  No need for it to persist between
function calls.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
13 years agofast-import: add 'ls' command
David Barr [Thu, 2 Dec 2010 10:40:20 +0000 (21:40 +1100)]
fast-import: add 'ls' command

Lazy fast-import frontend authors that want to rely on the backend to
keep track of the content of the imported trees _almost_ have what
they need in the 'cat-blob' command (v1.7.4-rc0~30^2~3, 2010-11-28).
But it is not quite enough, since

 (1) cat-blob can be used to retrieve the content of files, but
     not their mode, and

 (2) using cat-blob requires the frontend to keep track of a name
     (mark number or object id) for each blob to be retrieved

Introduce an 'ls' command to complement cat-blob and take care of the
remaining needs.  The 'ls' command finds what is at a given path
within a given tree-ish (tag, commit, or tree):

'ls' SP <dataref> SP <path> LF

or in fast-import's active commit:

'ls' SP <path> LF

The response is a single line sent through the cat-blob channel,
imitating ls-tree output.  So for example:

FE> ls :1 Documentation
gfi> 040000 tree 9e6c2b599341d28a2a375f8207507e0a2a627fe9 Documentation
FE> ls 9e6c2b599341d28a2a375f8207507e0a2a627fe9 git-fast-import.txt
gfi> 100644 blob 4f92954396e3f0f97e75b6838a5635b583708870 git-fast-import.txt
FE> ls :1 RelNotes
gfi> 120000 blob b942e499449d97aeb50c73ca2bdc1c6e6d528743 RelNotes
FE> cat-blob b942e499449d97aeb50c73ca2bdc1c6e6d528743
gfi> b942e499449d97aeb50c73ca2bdc1c6e6d528743 blob 32
gfi> Documentation/RelNotes/1.7.4.txt

The most interesting parts of the reply are the first word, which is
a 6-digit octal mode (regular file, executable, symlink, directory,
or submodule), and the part from the second space to the tab, which is
a <dataref> that can be used in later cat-blob, ls, and filemodify (M)
commands to refer to the content (blob, tree, or commit) at that path.

If there is nothing there, the response is "missing some/path".

The intent is for this command to be used to read files from the
active commit, so a frontend can apply patches to them, and to copy
files and directories from previous revisions.

For example, proposed updates to svn-fe use this command in place of
its internal representation of the repository directory structure.
This simplifies the frontend a great deal and means support for
resuming an import in a separate fast-import run (i.e., incremental
import) is basically free.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
13 years agoupdate-index --refresh --porcelain: add missing const
Jonathan Nieder [Tue, 22 Feb 2011 22:43:23 +0000 (22:43 +0000)]
update-index --refresh --porcelain: add missing const

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: add missing const to describe_detached_head
Jonathan Nieder [Tue, 22 Feb 2011 22:43:22 +0000 (22:43 +0000)]
checkout: add missing const to describe_detached_head

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDisallow empty section and variable names
Libor Pechacek [Tue, 1 Feb 2011 07:13:47 +0000 (08:13 +0100)]
Disallow empty section and variable names

It is possible to break your repository config by creating an invalid key.  The
config parser in turn chokes on it:

  $ git init
  Initialized empty Git repository in /tmp/gittest/.git/
  $ git config .foo false
  $ git config core.bare
  fatal: bad config file line 6 in .git/config

This patch makes git-config reject keys which start or end with a dot and adds
tests for these cases.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoSanity-check config variable names
Libor Pechacek [Sun, 30 Jan 2011 19:40:41 +0000 (20:40 +0100)]
Sanity-check config variable names

Sanity-check config variable names when adding and retrieving them.  As a side
effect code duplication between git_config_set_multivar and get_value (in
builtin/config.c) was removed and the common functionality was placed in
git_config_parse_key.

This breaks a test in t1300 which used invalid section-less keys in the tests
for "git -c". However, allowing such names there was useless, since there was
no way to set them via config file, and no part of git actually tried to use
section-less keys. This patch updates the test to use more realistic examples
as well as adding its own test.

Signed-off-by: Libor Pechacek <lpechacek@suse.cz>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 22 Feb 2011 06:46:09 +0000 (22:46 -0800)]
Merge branch 'maint'

* maint:
  Documentation: clarify -u<mode> option defaults

13 years agogit-checkout.txt: improve detached HEAD documentation
Jay Soffian [Sun, 20 Feb 2011 05:21:50 +0000 (00:21 -0500)]
git-checkout.txt: improve detached HEAD documentation

The detached HEAD state is a source of much confusion for users
new to git. Here we try to document it better.

Reworked from http://article.gmane.org/gmane.comp.version-control.git/138440

Requested-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: clarify -u<mode> option defaults
Clemens Buchacher [Mon, 21 Feb 2011 20:05:25 +0000 (21:05 +0100)]
Documentation: clarify -u<mode> option defaults

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 22 Feb 2011 01:20:11 +0000 (17:20 -0800)]
Merge branch 'maint'

* maint:
  t/t7500-commit.sh: use test_cmp instead of test
  t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate
  gitweb/gitweb.perl: don't call S_ISREG() with undef
  gitweb/gitweb.perl: remove use of qw(...) as parentheses

13 years agogit-p4: Add copy detection support
Vitor Antunes [Sun, 20 Feb 2011 01:18:25 +0000 (01:18 +0000)]
git-p4: Add copy detection support

Add new config options:
    git-p4.detectCopies         - Enable copy detection.
    git-p4.detectCopiesHarder   - Find copies harder.
The detectCopies option should be set to a true/false value.
The detectCopiesHarder option should be set to true/false value.
P4Submit can now process diff-tree C status and integrate files accordingly.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Acked-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: Improve rename detection support
Vitor Antunes [Sun, 20 Feb 2011 01:18:24 +0000 (01:18 +0000)]
git-p4: Improve rename detection support

Only open files for edit after integrating if the SHA1 of source and destination
differ from each other.
Add git config option detectRenames to allow permanent rename detection. This
options should be set to a true/false value.
Rename "detectRename" variable to "detectRenames" to make it more coherent with
the description in git man pages, which always use plural.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Acked-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/t7500-commit.sh: use test_cmp instead of test
Ævar Arnfjörð Bjarmason [Sat, 19 Feb 2011 18:29:09 +0000 (18:29 +0000)]
t/t7500-commit.sh: use test_cmp instead of test

Change commit_msg_is() in t/t7500-commit.sh to use test_cmp instead of
the shell's test function. Now if a test fails we'll get test_cmp
output showing us what failed.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate
Ævar Arnfjörð Bjarmason [Sat, 19 Feb 2011 18:16:19 +0000 (19:16 +0100)]
t/gitweb-lib.sh: Ensure that errors are shown for --debug --immediate

Because '--immediate' stops test suite after first error, therefore in
this mode

  test_debug 'cat gitweb.log'

was never ran, thus in effect negating effect of '--debug' option.
This made finidng the cause of errors in gitweb test sute difficult.

Modify the gitweb_run test subroutine to run test_debug itself in the
case of errors (and also remove "test_debug 'cat gitweb.log'" from
gitweb tests).

This makes it possible to run *gitweb tests* with --immediate ---debug
combination of options; also it makes gitweb tests to not output
spurious debug data that is not considered error.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb/gitweb.perl: don't call S_ISREG() with undef
Ævar Arnfjörð Bjarmason [Sat, 19 Feb 2011 15:27:42 +0000 (15:27 +0000)]
gitweb/gitweb.perl: don't call S_ISREG() with undef

Change S_ISREG($to_mode_oct) to S_ISREG($from_mode_oct) in the branch
that handles from modes, not to modes. This logic appears to have been
caused by copy/paste programming by Jakub Narebski in e8e41a93. It
would be better to rewrite this code not to be duplicated, but I
haven't done so.

This issue caused a failing test on perl 5.13.9, which has a warning
that turned this up:

     gitweb.perl: Use of uninitialized value in subroutine entry at /home/avar/g/git/t/../gitweb/gitweb.perl line 4415.

Which caused the Git test suite to fail on this test:

    ./t9500-gitweb-standalone-no-errors.sh             (Wstat: 256 Tests: 90 Failed: 84)
      Failed tests:  1-8, 10-36, 38-45, 47-48, 50-88
      Non-zero exit status: 1

Reported-by: perl 5.13.9
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb/gitweb.perl: remove use of qw(...) as parentheses
Ævar Arnfjörð Bjarmason [Sat, 19 Feb 2011 15:27:41 +0000 (15:27 +0000)]
gitweb/gitweb.perl: remove use of qw(...) as parentheses

Using the qw(...) construct as implicit parentheses was deprecated in
perl 5.13.5. Change the relevant code in gitweb to not use the
deprecated construct. The offending code was introduced in 3562198b by
Jakub Narebski.

The issue is that perl will now warn about this:

    $ perl -wE 'for my $i qw(a b) { say $i }'
    Use of qw(...) as parentheses is deprecated at -e line 1.
    a
    b

This caused gitweb.perl to warn on perl 5.13.5 and above, and these
tests to fail on those perl versions:

    ./t9501-gitweb-standalone-http-status.sh           (Wstat: 256 Tests: 11 Failed: 10)
      Failed tests:  2-11
      Non-zero exit status: 1
    ./t9502-gitweb-standalone-parse-output.sh          (Wstat: 256 Tests: 10 Failed: 9)
      Failed tests:  2-10
      Non-zero exit status: 1

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: support clone --bare
Pete Wyckoff [Sat, 19 Feb 2011 13:18:01 +0000 (08:18 -0500)]
git-p4: support clone --bare

Just like git clone --bare, build a .git directory but no
checked out files.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-By: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: decode p4 wildcard characters
Pete Wyckoff [Sat, 19 Feb 2011 13:18:00 +0000 (08:18 -0500)]
git-p4: decode p4 wildcard characters

There are four wildcard characters in p4.  Files with these
characters can be added to p4 repos using the "-f" option.
They are stored in %xx notation, and when checked out, p4
converts them back to normal.

This patch does the same thing when importing into git,
converting the four special characters.  Without this change,
the files appear with literal %xx in their names.

Be careful not to produce "*" in filenames on windows.  That
will fail.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: better message for "git-p4 sync" when not cloned
Pete Wyckoff [Sat, 19 Feb 2011 13:17:59 +0000 (08:17 -0500)]
git-p4: better message for "git-p4 sync" when not cloned

A common error is to do "git-p4 sync" in a repository that
was not initialized by "git-p4 clone".  There will be no
p4 refs.  The error message in this case is a traceback
for an assertion, which is confusing.

Change it instead to explain the likely problem.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-By: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: reinterpret confusing p4 message
Pete Wyckoff [Sat, 19 Feb 2011 13:17:58 +0000 (08:17 -0500)]
git-p4: reinterpret confusing p4 message

Error output will look like this:

glom$ git p4 clone //deopt
Importing from //deopt into .
Reinitialized existing Git repository in /tmp/x/.git/
Doing initial import of //deopt from revision #head into refs/remotes/p4/master
p4 returned an error: //deopt/... - must refer to client glom.

This particular p4 error is misleading.
Perhaps the depot path was misspelled.
Depot path:  //deopt

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: accommodate new move/delete type in p4
Pete Wyckoff [Sat, 19 Feb 2011 13:17:57 +0000 (08:17 -0500)]
git-p4: accommodate new move/delete type in p4

562d53f (git-p4: Fix sync errors due to new server version, 2010-01-21)
taught git-p4 sync to recognize the new move/delete type, but this type
can also show up in an initial clone and labels output.

Instead of replicating the support in three places, hoist the definition
somewhere global.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-By: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: add missing newline in initial import message
Pete Wyckoff [Sat, 19 Feb 2011 13:17:56 +0000 (08:17 -0500)]
git-p4: add missing newline in initial import message

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-By: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: fix key error for p4 problem
Pete Wyckoff [Sat, 19 Feb 2011 13:17:55 +0000 (08:17 -0500)]
git-p4: fix key error for p4 problem

Some p4 failures result in an error, but the info['code'] is not
set.  These include a bad p4 executable, or a core dump from p4,
and other odd internal errors where p4 fails to generate proper
marshaled output.

Make sure the info key exists before using it to avoid a python
traceback.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-p4: test script
Pete Wyckoff [Sat, 19 Feb 2011 13:17:54 +0000 (08:17 -0500)]
git-p4: test script

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiffcore-rename: improve estimate_similarity() heuristics
Linus Torvalds [Sat, 19 Feb 2011 04:12:06 +0000 (20:12 -0800)]
diffcore-rename: improve estimate_similarity() heuristics

The logic to quickly dismiss potential rename pairs was broken.  It
would too eagerly dismiss possible renames when all of the difference
was due to pure new data (or deleted data).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiffcore-rename: properly honor the difference between -M and -C
Linus Torvalds [Sat, 19 Feb 2011 04:10:32 +0000 (20:10 -0800)]
diffcore-rename: properly honor the difference between -M and -C

We would allow rename detection to do copy detection even when asked
purely for renames.  That confuses users, but more importantly it can
terminally confuse the recursive merge rename logic.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofor_each_hash: allow passing a 'void *data' pointer to callback
Linus Torvalds [Sat, 19 Feb 2011 03:55:19 +0000 (19:55 -0800)]
for_each_hash: allow passing a 'void *data' pointer to callback

For the find_exact_renames() function, this allows us to pass the
diff_options structure pointer to the low-level routines.  We will use
that to distinguish between the "rename" and "copy" cases.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclone: die when trying to clone missing local path
Jeff King [Fri, 18 Feb 2011 04:01:52 +0000 (23:01 -0500)]
clone: die when trying to clone missing local path

Since 86ac751 (Allow cloning an empty repository,
2009-01-23), doing:

  git clone does-not-exist

has created does-not-exist as an empty repository. This was
an unintentional side effect of 86ac751. Even weirder,
doing:

  git clone does-not-exist new-dir

_does_ fail, making this "feature" (if you want to consider
it such) broken. Let's detect this situation and explicitly
die. It's almost certainly not what the user intended.

This patch also adds two tests. One for the missing path
case, and one to confirm that a similar case, cloning a
non-repository directory, fails.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: skip terminal output tests on OS X
Jonathan Nieder [Thu, 17 Feb 2011 12:38:52 +0000 (06:38 -0600)]
tests: skip terminal output tests on OS X

On Mac OS X 10.5.0, test_terminal gets stuck reading from the pty
master every once in a while.  To reproduce the problem:

 perl -MIO::Pty -MFile::Copy -e '
for (my $i = 0;; $i++) {
my $master = new IO::Pty;
my $slave = $master->slave;
if (fork == 0) {
close $master or die "close: $!";
open STDOUT, ">&", $slave or die "dup2: $!";
close $slave or die "close: $!";
exec("echo", "hi", $i) or die "exec: $!";
}
close $slave or die "close: $!";
copy($master, \*STDOUT) or die "copy: $!";
close $master or die "close: $!";
wait;
}
 '

It blocks after 7000 iterations or so in sysread().  The relevant
sysread() call is the second call by the parent, which presumably
executes before the child dies but after the parent has read all
output from there.

Since this is an intermitent problem, the quick check of terminal
support in lib-terminal doesn't catch it.  Skip these tests on the Mac
for now.

Noticed-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-patch-id: do not trip over "no newline" markers
Michael J Gruber [Thu, 17 Feb 2011 07:44:42 +0000 (08:44 +0100)]
git-patch-id: do not trip over "no newline" markers

Currently, patch-id trips over our very own diff extension for marking
the absence of newline at EOF.

Fix it. (Ignore it, it's whitespace.)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-patch-id: test for "no newline" markers
Michael J Gruber [Wed, 16 Feb 2011 16:55:37 +0000 (17:55 +0100)]
git-patch-id: test for "no newline" markers

Currently, patch-id trips over our very own output that marks the absence
of newline at EOF.

Expose this in a test.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake <identifier> lowercase in Documentation
Michael J Gruber [Thu, 17 Feb 2011 07:48:06 +0000 (08:48 +0100)]
Make <identifier> lowercase in Documentation

Leaving uppercase abbreviations (e.g. URL) and an identifier named after
an upercase env variable (CVSROOT) in place, this adjusts the few
remaining cases and fixes an unidentified identifier along the way.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogrep --no-index: honor pathspecs correctly
Junio C Hamano [Wed, 16 Feb 2011 22:39:00 +0000 (14:39 -0800)]
grep --no-index: honor pathspecs correctly

Even though fill_directory() takes pathspec, the returned set of paths
is not guaranteed to be free of paths outside the pathspec. Perhaps we
would need to change that, but the current API is that the caller needs
to further filter them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Wed, 16 Feb 2011 22:33:22 +0000 (14:33 -0800)]
Merge branch 'maint'

* maint:
  parse_tag_buffer(): do not prefixcmp() out of range

13 years agoMerge branch 'maint-1.7.3' into maint
Junio C Hamano [Wed, 16 Feb 2011 22:33:11 +0000 (14:33 -0800)]
Merge branch 'maint-1.7.3' into maint

* maint-1.7.3:

13 years agoMerge branch 'maint-1.7.2' into maint-1.7.3
Junio C Hamano [Wed, 16 Feb 2011 22:32:59 +0000 (14:32 -0800)]
Merge branch 'maint-1.7.2' into maint-1.7.3

* maint-1.7.2:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command

13 years agoMerge branch 'maint-1.7.1' into maint-1.7.2
Junio C Hamano [Wed, 16 Feb 2011 22:32:54 +0000 (14:32 -0800)]
Merge branch 'maint-1.7.1' into maint-1.7.2

* maint-1.7.1:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command

13 years agoMerge branch 'maint-1.7.0' into maint-1.7.1
Junio C Hamano [Wed, 16 Feb 2011 22:32:47 +0000 (14:32 -0800)]
Merge branch 'maint-1.7.0' into maint-1.7.1

* maint-1.7.0:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command

13 years agomergetool: don't skip modify/remove conflicts
Martin von Zweigbergk [Wed, 16 Feb 2011 10:47:45 +0000 (05:47 -0500)]
mergetool: don't skip modify/remove conflicts

Since bb0a484 (mergetool: Skip autoresolved paths, 2010-08-17),
mergetool uses different ways of figuring out the list of files with
merge conflicts depending on whether rerere is active. If rerere is
active, mergetool will use 'git rerere status' to list the files with
remaining conflicts. However, the output from that command does not
list conflicts of types that rerere does not handle, such as
modify/remove conflicts.

Another problem with solely relying on the output from 'git rerere
status' is that, for new conflicts that are not yet known to rerere,
the output from the command will list the files even after adding them
to the index. This means that if the conflicts in some files have been
resolved and 'git mergetool' is run again, it will ask the user
something like the following for each of those files.

 file1: file does not need merging
 Continue merging other unresolved paths (y/n) ?

Solve both of these problems by replacing the call to 'git rerere
status' with a call to the new 'git rerere remaining' that was
introduced in the previous commit.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorerere "remaining"
Martin von Zweigbergk [Wed, 16 Feb 2011 10:47:44 +0000 (05:47 -0500)]
rerere "remaining"

After "rerere" resolves conflicts by reusing old resolution, there would
be three kinds of paths with conflict in the index:

 * paths that have been resolved in the working tree by rerere;
 * paths that need further work whose resolution could be recorded;
 * paths that need resolving that rerere won't help.

When the user wants a list of paths that need hand-resolving, output from
"rerere status" does not help, as it shows only the second category, but
the paths in the third category still needs work (rerere only makes sense
for regular files that have both our side and their side, and does not
help other kinds of conflicts, e.g. "we modified, they deleted").

The new subcommand "rerere remaining" can be used to show both. As
opposed to "rerere status", this subcommand also skips printing paths
that have been added to the index, since these paths are already
resolved and are no longer "remaining".

Initial patch provided by Junio. Refactored and modified to skip
resolved paths by Martin. Commit message mostly by Junio.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopush.default: Rename 'tracking' to 'upstream'
Johan Herland [Wed, 16 Feb 2011 00:54:24 +0000 (01:54 +0100)]
push.default: Rename 'tracking' to 'upstream'

Users are sometimes confused with two different types of "tracking" behavior
in Git: "remote-tracking" branches (e.g. refs/remotes/*/*) versus the
merge/rebase relationship between a local branch and its @{upstream}
(controlled by branch.foo.remote and branch.foo.merge config settings).

When the push.default is set to 'tracking', it specifies that a branch should
be pushed to its @{upstream} branch. In other words, setting push.default to
'tracking' applies only to the latter of the above two types of "tracking"
behavior.

In order to make this more understandable to the user, we rename the
push.default == 'tracking' option to push.default == 'upstream'.

push.default == 'tracking' is left as a deprecated synonym for 'upstream'.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoparse_tag_buffer(): do not prefixcmp() out of range
Nguyễn Thái Ngọc Duy [Mon, 14 Feb 2011 13:02:51 +0000 (20:02 +0700)]
parse_tag_buffer(): do not prefixcmp() out of range

There is a check (size < 64) at the beginning of the function, but
that only covers object+type lines.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit.c: reorder builtin command list
Nguyễn Thái Ngọc Duy [Tue, 15 Feb 2011 03:09:03 +0000 (10:09 +0700)]
git.c: reorder builtin command list

The majority of commands is in alphabet order except some. Reorder
them so it's easier to locate a command by eye and able to binary
search.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge: honor prepare-commit-msg hook
Jay Soffian [Tue, 15 Feb 2011 01:07:50 +0000 (20:07 -0500)]
merge: honor prepare-commit-msg hook

When a merge is stopped due to conflicts or --no-commit, the
subsequent commit calls the prepare-commit-msg hook. However,
it is not called after a clean merge. Fix this inconsistency
by invoking the hook after clean merges as well.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake <identifier> lowercase as per CodingGuidelines
Michael J Gruber [Tue, 15 Feb 2011 13:09:13 +0000 (14:09 +0100)]
Make <identifier> lowercase as per CodingGuidelines

*.c part for matches with '<[A-Z]+>' (and affected test).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake <identifier> lowercase as per CodingGuidelines
Michael J Gruber [Tue, 15 Feb 2011 13:09:12 +0000 (14:09 +0100)]
Make <identifier> lowercase as per CodingGuidelines

*.c part for matches with '"[A-Z]+"'.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake <identifier> lowercase as per CodingGuidelines
Michael J Gruber [Tue, 15 Feb 2011 13:09:11 +0000 (14:09 +0100)]
Make <identifier> lowercase as per CodingGuidelines

parse-options part

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoCodingGuidelines: downcase placeholders in usage messages
Junio C Hamano [Tue, 15 Feb 2011 19:02:56 +0000 (11:02 -0800)]
CodingGuidelines: downcase placeholders in usage messages

We accumulated some inconsistencies without an explicit guidance to spell
this out over time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosmart-http: Don't use Expect: 100-Continue
Shawn O. Pearce [Tue, 15 Feb 2011 16:57:24 +0000 (08:57 -0800)]
smart-http: Don't use Expect: 100-Continue

Some HTTP/1.1 servers or proxies don't correctly implement the
100-Continue feature of HTTP/1.1.  Its a difficult feature to
implement right, and isn't commonly used by browsers, so many
developers may not even be aware that their server (or proxy)
doesn't honor it.

Within the smart HTTP protocol for Git we only use this newer
"Expect: 100-Continue" feature to probe for missing authentication
before uploading a large payload like a pack file during push.
If authentication is necessary, we expect the server to send the
401 Not Authorized response before the bulk data transfer starts,
thus saving the client bandwidth during the retry.

A different method to probe for working authentication is to send an
empty command list (that is just "0000") to $URL/git-receive-pack.
or $URL/git-upload-pack.  All versions of both receive-pack and
upload-pack since the introduction of smart HTTP in Git 1.6.6
cleanly accept just a flush-pkt under --stateless-rpc mode, and
exit with success.

If HTTP level authentication is successful, the backend will return
an empty response, but with HTTP status code 200.  This enables
the client to continue with the transfer.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 15 Feb 2011 19:03:22 +0000 (11:03 -0800)]
Merge branch 'maint'

* maint:
  pull: do not display fetch usage on --help-all
  git-tag.txt: list all modes in the description
  commit,status: describe -u likewise
  add: describe --patch like checkout, reset
  commit,merge,tag: describe -m likewise
  clone,init: describe --template using the same wording
  commit,status: describe --porcelain just like push
  commit,tag: use same wording for -F
  configure: use AC_LANG_PROGRAM consistently
  string_list_append: always set util pointer to NULL
  correct type of EMPTY_TREE_SHA1_BIN

13 years agopull: do not display fetch usage on --help-all
Michael J Gruber [Mon, 14 Feb 2011 16:48:08 +0000 (17:48 +0100)]
pull: do not display fetch usage on --help-all

Currently, "git pull --help-all" displays the fetch usage info.

Make it equivalent to "git pull -h" instead since "--help-all" is
documented in gitcli(7).

Do not try to sanitize the pull option parser (aka last hair puller).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-tag.txt: list all modes in the description
Michael J Gruber [Tue, 15 Feb 2011 13:09:10 +0000 (14:09 +0100)]
git-tag.txt: list all modes in the description

Currently, the description sounds as if it applied always, but most of
its content is true in "create tag mode" only.

Make this clearer by listing all modes upfront.

Also, sneak in some linguistic improvements and make it clearer that
lightweight tags are "created" because "written" may be misread as
"are output".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,status: describe -u likewise
Michael J Gruber [Tue, 15 Feb 2011 13:09:09 +0000 (14:09 +0100)]
commit,status: describe -u likewise

They differ by one character only. Being exactly equal should help
translations.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd: describe --patch like checkout, reset
Michael J Gruber [Tue, 15 Feb 2011 13:09:08 +0000 (14:09 +0100)]
add: describe --patch like checkout, reset

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,merge,tag: describe -m likewise
Michael J Gruber [Tue, 15 Feb 2011 13:09:07 +0000 (14:09 +0100)]
commit,merge,tag: describe -m likewise

This also removes the superfluous "specify" and rewords the misleading
"if any" which sounds as if omitting "-m" would omit the merge commit
message. (It means "if a merge commit is created at all".)

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclone,init: describe --template using the same wording
Michael J Gruber [Tue, 15 Feb 2011 13:09:06 +0000 (14:09 +0100)]
clone,init: describe --template using the same wording

This also corrects a wrong description for clone.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,status: describe --porcelain just like push
Michael J Gruber [Tue, 15 Feb 2011 13:09:05 +0000 (14:09 +0100)]
commit,status: describe --porcelain just like push

Push has the clearer description, so take that one for all.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit,tag: use same wording for -F
Michael J Gruber [Tue, 15 Feb 2011 13:09:04 +0000 (14:09 +0100)]
commit,tag: use same wording for -F

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>