Commit graph

18319 commits

Author SHA1 Message Date
Junio C Hamano 442dd42d6d Merge branch 'maint'
* maint:
  Update draft release notes to 1.6.2.2
  Fix bash completion in path with spaces
  bash completion: only show 'log --merge' if merging
  git-tag(1): add hint about commit messages
  Documentation: update graph api example.
2009-03-30 13:29:57 -07:00
Junio C Hamano 8c7f788238 Update draft release notes to 1.6.2.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 13:29:31 -07:00
Junio C Hamano b19293df9e Merge branch 'maint-1.6.1' into maint
* maint-1.6.1:
  Fix bash completion in path with spaces
  bash completion: only show 'log --merge' if merging
  git-tag(1): add hint about commit messages
  Documentation: update graph api example.

Conflicts:
	contrib/completion/git-completion.bash
2009-03-30 13:25:27 -07:00
Junio C Hamano dcbf041745 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  Fix bash completion in path with spaces
  bash completion: only show 'log --merge' if merging
  git-tag(1): add hint about commit messages
  Documentation: update graph api example.
2009-03-30 13:23:53 -07:00
Santi Béjar 01eadafccb Documentation: push.default applies to all remotes
push.default is not only for the current remote but setting the default
behaviour for all remotes.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 09:20:41 -07:00
Santi Béjar 76d3cc50b5 Documentation: enhance branch.<name>.{remote,merge}
The documentation for branch.*.merge is very dense, so add a simple
explanation on top of it.

And branch.*.remote also affects 'git push'.

Signed-off-by: Santi Béjar <santi@agolina.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 09:19:37 -07:00
Daniel Cheng (aka SDiZ) ba7906f2f4 Fix bash completion in path with spaces
Signed-off-by: Daniel Cheng (aka SDiZ) <j16sdiz+freenet@gmail.com>
Trivially-acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 09:07:03 -07:00
Thomas Rast 67f1fe5f08 bash completion: only show 'log --merge' if merging
The gitk completion only shows --merge if MERGE_HEAD is present.
Do it the same way for git-log completion.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 09:06:48 -07:00
Nico -telmich- Schottelius abfd5fa872 git-tag(1): add hint about commit messages
If a tag is not annotated, git tag displays the commit message
instead. Add this hint to the manpage to unhide this secret.

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 09:00:04 -07:00
Allan Caffee 7b60d0d3e4 Documentation: update graph api example.
As of commit 03300c0 the graph API uses '*' for all nodes including merges.
This updates the example in the documentation to match.

Signed-off-by: Allan Caffee <allan.caffee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 08:59:45 -07:00
Christian Couder 7428d754e2 rev-list: pass "revs" to "show_bisect_vars"
instead of using static "revs" data

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:54 -07:00
Christian Couder 6a17fad733 rev-list: make "show_bisect_vars" non static
and declare it in "bisect.h" as we will use this function later.

While at it, rename its last argument "show_all" instead of
"bisect_find_all".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:54 -07:00
Christian Couder 9996983c9c rev-list: move code to show bisect vars into its own function
This is a straightforward clean up to make "cmd_rev_list" function
smaller.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:54 -07:00
Christian Couder a2ad79ced2 rev-list: move bisect related code into its own file
This patch creates new "bisect.c" and "bisect.h" files and move
bisect related code into these files.

While at it, we also remove some include directives that are not
needed any more from the beginning of "builtin-rev-list.c".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:54 -07:00
Christian Couder ff62d732d8 rev-list: make "bisect_list" variable local to "cmd_rev_list"
The "bisect_list" variable was static for no reason as it is only used
in the "cmd_rev_list" function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:54 -07:00
Christian Couder 2a8177b63d refs: add "for_each_ref_in" function to refactor "for_each_*_ref" functions
The "for_each_{tag,branch,remote,replace,}_ref" functions are
redefined in terms of "for_each_ref_in" so that we can lose the
hardcoded length of prefix strings from the code.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2009-03-30 01:22:53 -07:00
Christian Couder eaa759b914 quote: add "sq_dequote_to_argv" to put unwrapped args in an argv array
This new function unwraps the space separated shell quoted elements in
its first argument and places them in the argv array passed as its second
argument.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:53 -07:00
Christian Couder ebbc088e13 quote: implement "sq_dequote_many" to unwrap many args in one string
The sq_dequote() function does not allow parsing a string with more than
one single-quoted parameter easily; use its code to implement a new API
sq_dequote_step() to allow the caller iterate through such a string to
parse them one-by-one.  The original sq_dequote() becomes a thin wrapper
around it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-30 01:22:53 -07:00
Junio C Hamano f2ad051fd1 Merge branch 'maint'
* maint:
  git-svn: fix ls-tree usage with dash-prefixed paths
  import-zips: fix thinko
2009-03-29 23:11:23 -07:00
Junio C Hamano 510a309e5e Merge branch 'maint-1.6.1' into maint
* maint-1.6.1:
  import-zips: fix thinko
2009-03-29 23:11:13 -07:00
Junio C Hamano 8e4f767ba7 Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
  import-zips: fix thinko
2009-03-29 23:11:03 -07:00
Jay Soffian c18f75a1e9 send-email: add tests for refactored prompting
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 21:41:28 -07:00
Jay Soffian 6e1825186b send-email: refactor and ensure prompting doesn't loop forever
Several places in send-email prompt for input, and will do so forever
when the input is EOF. This is poor behavior when send-email is run
unattended (say from cron).

This patch refactors the prompting to an ask() function which takes a
prompt, an optional default, and an optional regex to validate the
input. The function returns on EOF, or if a default is provided and the
user simply types return, or if the input passes the validating regex
(which accepts all input by default). The ask() function gives up after
10 tries in case of invalid input.

There are four callers of the function:

1) "Who should the emails appear to be from?" which provides a default
sender. Previously the user would have to type ctrl-d to accept the
default. Now the user can just hit return, or type ctrl-d.

2) "Who should the emails be sent to?". Previously this prompt passed a
second argument ("") to $term->readline() which was ignored. I believe
the intent was to allow the user to just hit return. Now the user
can do so, or type ctrl-d.

3) "Message-ID to be used as In-Reply-To for the first email?".
Previously this prompt passed a second argument (effectively undef) to
$term->readline() which was ignored. I believe the intent was the same
as for (2), to allow the user to just hit return. Now the user can do
so, or type ctrl-d.

4) "Send this email?". Previously this prompt would loop forever until
it got a valid reply. Now it stops prompting on EOF or a valid reply. In
the case where confirm = "inform", it now defaults to "y" on EOF or the
user hitting return, otherwise an invalid reply causes send-email to
terminate.

A followup patch adds tests for the new functionality.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 21:41:03 -07:00
Eric Wong b8fee3a388 git-svn: fix ls-tree usage with dash-prefixed paths
To find the blob object name given a tree and pathname, we were
incorrectly calling "git ls-tree" with a "--" argument followed
by the pathname of the file we wanted to get.

  git ls-tree <TREE> -- --dashed/path/name.c

Unlike many command-line interfaces, the "--" alone does not
symbolize the end of non-option arguments on the command-line.

ls-tree interprets the "--" as a prefix to match against, thus
the entire contents of the --dashed/* hierarchy would be
returned because the "--" matches "--dashed" and every path
under it.

Thanks to Anton Gyllenberg for pointing me toward the
Twisted repository as a real-world example of this case.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:58:10 -07:00
Johannes Schindelin 63801da88d import-zips: fix thinko
Embarrassingly, the common prefix calculation did not work properly, due
to a mistake in the assignment: instead of assigning the dirname of the
current file name, the dirname of the current common prefix needs to
be assigned to common prefix, when the current prefix does not match the
current file name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:56:26 -07:00
Erik Faye-Lund 1982467d92 builtin-fast-export.c: handle nested tags
When tags that points to tags are passed to fast-export, an error is given,
saying "Tag [TAGNAME] points nowhere?". This fix calls parse_object() on the
object before referencing it's tag, to ensure the tag-info is fully initialized.
In addition, it inserts a comment to point out where nested tags are handled.
This is consistent with the comment for signed tags.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:48:43 -07:00
Erik Faye-Lund c0582c53bc builtin-fast-export.c: fix crash on tagged trees
If a tag object points to a tree (or another unhandled type), the commit-
pointer is left uninitialized and later dereferenced. This patch adds a
default case to the switch that issues a warning and skips the object.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:48:43 -07:00
Erik Faye-Lund 2d07f6d4b7 builtin-fast-export.c: turn error into warning
fast-import doesn't have a syntax to support tree-objects (and some other
object-types), so fast-export shouldn't handle them. However, aborting the
operation is a bit drastic. This patch turns the error into a warning instead.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:48:43 -07:00
Erik Faye-Lund 41a5c70f2c test-suite: adding a test for fast-export with tag variants
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-29 19:48:39 -07:00
Simon Arlott 18d5cf908f git-svn: don't output git commits in quiet mode
Ideally only errors should be output in this mode so fetch
can be run from cron and normally produce no output. Without
this change it would output a single line on each git commit,
e.g.
r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-03-29 15:42:00 -07:00
Eric Wong 4f821012c3 git-svn: fix ls-tree usage with dash-prefixed paths
To find the blob object name given a tree and pathname, we were
incorrectly calling "git ls-tree" with a "--" argument followed
by the pathname of the file we wanted to get.

  git ls-tree <TREE> -- --dashed/path/name.c

Unlike many command-line interfaces, the "--" alone does not
symbolize the end of non-option arguments on the command-line.

ls-tree interprets the "--" as a prefix to match against, thus
the entire contents of the --dashed/* hierarchy would be
returned because the "--" matches "--dashed" and every path
under it.

Thanks to Anton Gyllenberg for pointing me toward the
Twisted repository as a real-world example of this case.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2009-03-28 23:00:05 -07:00
Junio C Hamano 17e61b8288 set_shared_perm(): sometimes we know what the final mode bits should look like
adjust_shared_perm() first obtains the mode bits from lstat(2), expecting
to find what the result of applying user's umask is, and then tweaks it
as necessary.  When the file to be adjusted is created with mkstemp(3),
however, the mode thusly obtained does not have anything to do with user's
umask, and we would need to start from 0444 in such a case and there is no
point running lstat(2) for such a path.

This introduces a new API set_shared_perm() to bypass the lstat(2) and
instead force setting the mode bits to the desired value directly.
adjust_shared_perm() becomes a thin wrapper to the function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28 08:02:15 -07:00
Junio C Hamano 3be1f18e1b move_temp_to_file(): do not forget to chmod() in "Coda hack" codepath
Now move_temp_to_file() is responsible for doing everything that is
necessary to turn a tempfile in $GIT_DIR into its final form, it must make
sure "Coda hack" codepath correctly makes the file read-only.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28 08:01:21 -07:00
Junio C Hamano b0085a7167 Merge branch 'maint'
* maint:
  test-lib: Clean up comments and Makefile.
  diff --no-index: Do not generate patch output if other output is requested
2009-03-28 01:16:46 -07:00
Junio C Hamano a1b1ae0571 Update draft release notes to 1.6.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28 00:55:52 -07:00
Junio C Hamano aa72a14a7f Merge branch 'jc/maint-1.6.0-diff-borrow-carefully'
* jc/maint-1.6.0-diff-borrow-carefully:
  diff --cached: do not borrow from a work tree when a path is marked as assume-unchanged
2009-03-28 00:42:31 -07:00
Junio C Hamano 48bcfbd134 Merge branch 'js/remote-improvements'
* js/remote-improvements:
  remote: improve sorting of "configure for git push" list
2009-03-28 00:42:22 -07:00
Junio C Hamano 869e13e246 Merge branch 'jk/clone-post-checkout'
* jk/clone-post-checkout:
  githooks documentation: post-checkout hook is also called after clone
2009-03-28 00:42:17 -07:00
Junio C Hamano 9d5156496d Merge branch 'maint-1.6.1' into maint
* maint-1.6.1:
  test-lib: Clean up comments and Makefile.
  diff --no-index: Do not generate patch output if other output is requested
2009-03-28 00:41:50 -07:00
Emil Sit 81db4abf84 test-lib: Clean up comments and Makefile.
Bring documentation in test-lib and clean target
in Makefile in-line with abc5d372.

Signed-off-by: Emil Sit <sit@emilsit.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-28 00:11:27 -07:00
Michael Hendricks d7d9c2d049 format-patch: add arbitrary email headers
format-patch supports the format.headers configuration for adding
arbitrary email headers to the patches it outputs.  This patch adds
support for an --add-header argument which makes the same feature
available from the command line.  This is useful when the content of
custom email headers must change from branch to branch.

This patch has been sponsored by Grant Street Group

Signed-off-by: Michael Hendricks <michael@ndrix.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 23:49:50 -07:00
Johan Herland fb8b193670 Move chmod(foo, 0444) into move_temp_to_file()
When writing out a loose object or a pack (index), move_temp_to_file() is
called to finalize the resulting file. These files (loose files and packs)
should all have permission mode 0444 (modulo adjust_shared_perm()).
Therefore, instead of doing chmod(foo, 0444) explicitly from each callsite
(or even forgetting to chmod() at all), do the chmod() call from within
move_temp_to_file().

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 22:10:58 -07:00
Junio C Hamano 5a688fe470 "core.sharedrepository = 0mode" should set, not loosen
This fixes the behaviour of octal notation to how it is defined in the
documentation, while keeping the traditional "loosen only" semantics
intact for "group" and "everybody".

Three main points of this patch are:

 - For an explicit octal notation, the internal shared_repository variable
   is set to a negative value, so that we can tell "group" (which is to
   "OR" in 0660) and 0660 (which is to "SET" to 0660);

 - git-init did not set shared_repository variable early enough to affect
   the initial creation of many files, notably copied templates and the
   configuration.  We set it very early when a command-line option
   specifies a custom value.

 - Many codepaths create files inside $GIT_DIR by various ways that all
   involve mkstemp(), and then call move_temp_to_file() to rename it to
   its final destination.  We can add adjust_shared_perm() call here; for
   the traditional "loosen-only", this would be a no-op for many codepaths
   because the mode is already loose enough, but with the new behaviour it
   makes a difference.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 21:51:04 -07:00
Michele Ballabio 3f7d99282d rebase: fix typo (force_rebas -> force-rebas)
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 14:26:34 -07:00
Christian Couder b09b868f7f log-tree: fix patch filename computation in "git format-patch"
When using "git format-patch", "get_patch_filename" in
"log-tree.c" calls "strbuf_splice" that could die with
the following message:

"`pos + len' is too far after the end of the buffer"

if you have:

	buf->len < start_len + FORMAT_PATCH_NAME_MAX

but:

	buf->len + suffix_len > start_len + FORMAT_PATCH_NAME_MAX

This patch tries to get rid of that bug.

[jc: w/ simplified logic]

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 01:10:27 -07:00
Michael J Gruber 57dac0bfe4 Test for local branches being followed with --track
According to the documentation, it is perfectly okay to follow local
branches using the --track option. Introduce a test which checks whether
they behave the same. Currently one test fails.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 01:08:36 -07:00
Thomas Rast 2d266f9d62 Documentation: format-patch --root clarifications
Users were confused about the meaning and use of the --root option.
Notably, since 68c2ec7 (format-patch: show patch text for the root
commit, 2009-01-10), --root has nothing to do with showing the patch
text for the root commit any more.

Shorten and clarify the corresponding paragraph in the DESCRIPTION
section, document --root under OPTIONS, and add an explicit note that
root commits are formatted regardless.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:38:01 -07:00
Junio C Hamano 3278609310 Merge branch 'cj/doc-quiet' into cj/doc-format
* cj/doc-quiet:
  Documentation/Makefile: break up texi pipeline
  Documentation/Makefile: make most operations "quiet"

Conflicts:
	Documentation/Makefile
2009-03-27 00:36:47 -07:00
Chris Johnsen 5121a6d993 Documentation: option to render literal text as bold for manpages
This allows manpages viewed on a tty to render inline literal
text in a manner that is distinct from the surrounding text.

The initial implementation (pre-mailing-list) of this patch
included a conditional variant of the XSLT code in
manpage-base.xsl and use xmlto's --stringparam option to
optionally enable the functionality. It turns out that
--stringparam is broken in all versions of xmlto except for the
pre-release, SVN version. Since xmlto is a shell script the patch
to fix it is simple enough, but I instead opted to use xmlto's
"module" functionality.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:33:20 -07:00
Chris Johnsen 0c04f52735 Documentation: asciidoc.conf: fix verse block with block titles
No files use the variant of block-title with verse-block, but
such a case would have generated broken docbook XML (<simpara> is
not allowed inside <para>). This fixes the potential deviation from
valid docbook XML.

Testing done with asciidoc 8.3.1 and docbook-xsl 1.74.0.

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-27 00:33:20 -07:00