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

28214 Commits

Author SHA1 Message Date
Jakub Narebski
36612e4daf gitweb: Handle invalid regexp in regexp search
When using regexp search ('sr' parameter / $search_use_regexp variable
is true), check first that regexp is valid.

Without this patch we would get an error from Perl during search (if
searching is performed by gitweb), or highlighting matches substring
(if applicable), if user provided invalid regexp... which means broken
HTML, with error page (including HTTP headers) generated after gitweb
already produced some output.

Add test that illustrates such error: for example for regexp "*\.git"
we would get the following error:

  Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE \.git/
  at /var/www/cgi-bin/gitweb.cgi line 3084.

Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28 11:45:31 -08:00
Nguyễn Thái Ngọc Duy
989937221a rev-list: fix --verify-objects --quiet becoming --objects
When --quiet is specified, finish_object() is called instead of
show_object(). The latter is in charge of --verify-objects and
will be skipped  if --quiet is specified.

Move the code up to finish_object(). Also pass the quiet flag along
and make it always call show_* functions to avoid similar problems in
future.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28 10:47:30 -08:00
Nguyễn Thái Ngọc Duy
8ba8fe049f rev-list: remove BISECT_SHOW_TRIED flag
Since c99f069 (bisect--helper: remove "--next-vars" option as it is
now useless - 2009-04-21), this flag has always been off. Remove the
flag and all related code.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-28 10:47:28 -08:00
Jiang Xin
71eb87890a Merge pull request from jiangxin/master
l10n: translation for Simplified Chinese.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-02-29 00:40:07 +08:00
Jiang Xin
7ac1c0adeb l10n: update Chinese translation to the new git.po
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-02-28 12:24:54 +08:00
Jiang Xin
1d4ac88d67 l10n: Update git.pot (12 new messages)
Update file 'po/git.pot' to v1.7.9.2-315-g25a78 (Merge branch 'maint'),
with 12 new string additions.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-02-28 12:24:20 +08:00
Jiang Xin
508d1244dc Merge branch 'master' into git-po 2012-02-28 12:23:26 +08:00
Jan Krüger
42b00599be symbolic-ref --short: abbreviate the output unambiguously
It can be helpful to resolve a symbolic ref and output the result in a
shortened form, such as for use in shell prompts.  Add a "--short" option
to do so.

Signed-off-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 15:58:36 -08:00
Junio C Hamano
25a7850a10 Merge branch 'maint'
* maint:
  Update draft release notes to 1.7.9.3
  CodingGuidelines: do not use 'which' in shell scripts
  CodingGuidelines: Add a note about spaces after redirection
  post-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly
  post-receive-email: remove unused variable
2012-02-27 15:37:02 -08:00
Junio C Hamano
b0fa280751 Update draft release notes to 1.7.9.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 15:36:08 -08:00
Junio C Hamano
67f8d5b87d Merge branch 'pj/remote-set-branches-usage-fix' into maint
* pj/remote-set-branches-usage-fix:
  remote: fix set-branches usage and documentation

Conflicts:
	builtin/remote.c
2012-02-27 15:33:33 -08:00
Junio C Hamano
e22c522730 Merge branch 'jn/gitweb-unborn-head' into maint
* jn/gitweb-unborn-head:
  gitweb: Fix "heads" view when there is no current branch
2012-02-27 15:33:26 -08:00
Junio C Hamano
bdf26fcbea Merge branch 'jn/ancient-meld-support' into maint
* jn/ancient-meld-support:
  mergetools/meld: Use --help output to detect --output support
2012-02-27 15:33:07 -08:00
Junio C Hamano
4eed30a7cb Merge branch 'tr/merge-edit-guidance' into maint
* tr/merge-edit-guidance:
  merge: add instructions to the commit message when editing
2012-02-27 15:31:50 -08:00
Tim Henigan
860f70f9f4 CodingGuidelines: do not use 'which' in shell scripts
During the code review of a recent patch, it was noted that shell scripts
must not use 'which $cmd' to check the availability of the command $cmd.
The output of the command is not machine parseable and its exit code is
not reliable across platforms.

It is better to use 'type' to accomplish this task.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 15:10:23 -08:00
Tim Henigan
48f359bfaf CodingGuidelines: Add a note about spaces after redirection
During code review of some patches, it was noted that redirection operators
should have space before, but no space after them.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 12:41:13 -08:00
Tim Henigan
1252bbe1c6 contrib: add git-diffall script
The 'git difftool' allows the user to view diffs using an external tool.
It runs a separate instance of the tool for each file in the diff. This
makes it tedious to review changes spanning multiple files.

The 'git-diffall' script instead prepares temporary directories with the
files to be compared and launches a single instance of the external diff
tool to view them (i.e. a directory diff).

The 'diff.tool' or 'merge.tool' configuration variable is used to specify
which external tool is used.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 12:37:10 -08:00
Zbigniew Jędrzejewski-Szmek
ff3d656b7c git-p4: missing she-bang line in t9804 confuses prove
Without the magic line, prove shows lots and lots of errors:
% prove ./t9804-git-p4-label.sh
./t9804-git-p4-label.sh .. syntax error at ./t9804-git-p4-label.sh line 3, near ". ."
...

When #!/bin/sh is added, tests are skipped (I have no p4d).

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 12:24:09 -08:00
Michał Kiedrowicz
d29d787cd6 grep -P: add tests for matching ^ and $
Earlier, fba4f1 (grep -P: Fix matching ^ and $) fixed an ancient bug.  Add
some tests to protect the change from future breakages; a slightly broken
version of this was a part of the originally submitted patch.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 12:21:51 -08:00
Carlos Martín Nieto
6c41e97557 branch: don't assume the merge filter ref exists
print_ref_list looks up the merge_filter_ref and assumes that a valid
pointer is returned. When the object doesn't exist, it tries to
dereference a NULL pointer. This can be the case when git branch
--merged is given an argument that isn't a valid commit name.

Check whether the lookup returns a NULL pointer and die with an error
if it does. Add a test, while we're at it.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 11:35:33 -08:00
Michael Haggerty
64baa4153b post-receive-email: match up $LOGBEGIN..$LOGEND pairs correctly
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 11:01:16 -08:00
Michael Haggerty
c48be8b759 post-receive-email: remove unused variable
prep_for_email neither is passed a fourth argument nor uses it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 11:01:15 -08:00
Zbigniew Jędrzejewski-Szmek
3ddf9228b4 send-email: document the --smtp-debug option
The option was already shown in -h output, so it should be documented
in the man page.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Suggested-by: David A. Greene <greened@obbligato.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-27 10:29:24 -08:00
Yichao Yu
0ad9e96d2e l10n: fast-forward here is ff-only merge, not push
Signed-off-by: Yichao Yu <yyc1992@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-02-27 23:36:53 +08:00
Riku
d4a8e00b32 l10n: update zh_CN translation for "Fetching %s"
Signed-off-by: Riku <lu.riku@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2012-02-27 23:18:45 +08:00
Junio C Hamano
3724cc7c58 Update draft release notes to 1.7.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 23:11:10 -08:00
Junio C Hamano
507fba2b98 Merge branch 'jn/gitweb-search-optim'
* jn/gitweb-search-optim:
  gitweb: Faster project search
  gitweb: Option for filling only specified info in fill_project_list_info
  gitweb: Refactor checking if part of project info need filling
2012-02-26 23:05:56 -08:00
Junio C Hamano
ac1373f1c2 Merge branch 'tr/maint-bundle-long-subject'
* tr/maint-bundle-long-subject:
  t5704: match tests to modern style
  strbuf: improve strbuf_get*line documentation
  bundle: use a strbuf to scan the log for boundary commits
  bundle: put strbuf_readline_fd in strbuf.c with adjustments
2012-02-26 23:05:51 -08:00
Junio C Hamano
200e96e4af Merge branch 'sp/smart-http-failure-to-push'
* sp/smart-http-failure-to-push:
  : Mask SIGPIPE on the command channel going to a transport helper
  disconnect from remote helpers more gently

Conflicts:
	transport-helper.c
2012-02-26 23:05:48 -08:00
Junio C Hamano
d365a43227 Merge branch 'fc/push-prune'
* fc/push-prune:
  push: add '--prune' option
  remote: refactor code into alloc_delete_ref()
  remote: reorganize check_pattern_match()
  remote: use a local variable in match_push_refs()

Conflicts:
	builtin/push.c
2012-02-26 23:05:45 -08:00
Junio C Hamano
5419127d04 Merge branch 'jc/doc-merge-options'
* jc/doc-merge-options:
  Documentation/merge-options.txt: group "ff" related options together
2012-02-26 23:05:42 -08:00
Junio C Hamano
31e3d834b3 Merge branch 'jk/maint-avoid-streaming-filtered-contents'
* jk/maint-avoid-streaming-filtered-contents:
  do not stream large files to pack when filters are in use
  teach dry-run convert_to_git not to require a src buffer
  teach convert_to_git a "dry run" mode
2012-02-26 23:05:38 -08:00
Junio C Hamano
ce25054826 Merge branch 'jb/filter-ignore-sigpipe'
* jb/filter-ignore-sigpipe:
  Ignore SIGPIPE when running a filter driver
2012-02-26 23:05:31 -08:00
Junio C Hamano
a61ba26a47 test: "am -3" can accept non-standard -p<num>
This adds a test for the previous one to make sure that "am -3 -p0" can
read patches created with the --no-prefix option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 23:02:59 -08:00
Jakub Narebski
e607b79fb1 gitweb: Highlight matched part of shortened project description
Previous commit make gitweb use esc_html_match_hl() to mark match in
the _whole_ description of a project when searching projects.

This commit makes gitweb highlight match in _shortened_ description,
based on match in whole description, using esc_html_match_hl_chopped()
subroutine.

If match is in removed (chopped) part, even partially, then trailing
"... " is highlighted.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 22:02:58 -08:00
Jakub Narebski
5fb3cf2317 gitweb: Highlight matched part of project description when searching projects
Use esc_html_match_hl() from earlier commit to mark match in the
_whole_ description when searching projects.

Currently, with this commit, when searching projects there is always
shown full description of a project, and not a shortened one (like for
ordinary projects list view), even if the match is on project name and
not project description.  Because we always show full description of a
project, and not possibly shortened name, there is no need for having
full description on mouseover via title attribute.

Showing full description when there is match on it is useful to avoid
situation where match is in shortened, invisible part.  On the other
hand that makes project search different than projects list view; also
there can be problems with overly-long project descriptions.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 22:02:57 -08:00
Jakub Narebski
07a40062ae gitweb: Highlight matched part of project name when searching projects
Use esc_html_match_hl() introduced in previous commit to escape HTML
and mark match, using span element with 'match' class.  Currently only
the 'path' part (i.e. the project name) is highlighted; match might be
on the project description.  Highlighting match in description is left
for next commit.

The code makes use of the fact that defined $search_regexp means that
there was search going on.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 22:02:56 -08:00
Jakub Narebski
337da8d2b0 gitweb: Introduce esc_html_match_hl and esc_html_hl_regions
The esc_html_match_hl() subroutine added in this commit will be used
to highlight *all* matches of given regexp, using 'match' class.
Ultimately it is to be used in all match highlighting, starting
with project search, which does not have it yet.

It uses the esc_html_hl_regions() subroutine, which is meant to
highlight in a given string a list of regions (given as a list of
[ beg, end ] pairs of positions in string), using HTML <span> element
with given class.  It could probably be used in other places that
do highlighting of part of ready line, like highlighting of changes
in a diff (diff refinement highlighting).

Implementation and enhancement notes:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Currently esc_html_hl_regions() subroutine doesn't accept any
  parameters, like esc_html() does.  We might want for example to
  pass  nbsp=>1  to it.

  It can easily be done with the following code:

    my %opts = grep { ref($_) ne "ARRAY" } @sel;
    @sel     = grep { ref($_) eq "ARRAY" } @sel;

  This allow adding parameters after or before regions, e.g.:

    esc_html_hl_regions("foo bar", "mark", [ 0, 3 ], -nbsp => 1);

* esc_html_hl_regions() escapes like esc_html(); if we wanted to
  highlight with esc_path(), we could pass subroutine reference
  to now named esc_gen_hl_regions().

    esc_html_hl_regions("foo bar", "mark", \&esc_path, [ 0, 3 ]);

  Note that this way we can handle -nbsp=>1 case automatically,
  e.g.

    esc_html_hl_regions("foo bar", "mark",
                        sub { esc_html(@_, -nbsp=>1) },
                        [ 0, 3 ]);

* Alternate solution for highlighting region of a string would be to
  use the idea that strings are to be HTML-escaped, and references to
  scalars are HTML (like in the idea for generic committags).

  This would require modifying gitweb code or esc_html to get list of
  fragments, e.g.:

    esc_html(\'<span class="mark">', 'foo', \'</span>', ' bar',
             { -nbsp => 1 });

  or

    esc_html([\'<span class="mark">', 'foo', \'</span>', ' bar'],
             -nbsp=>1);

  esc_html_match_hl() could be then simple wrapper around "match
  formatter", e.g.

    esc_html([ render_match_hl($str, $regexp) ], -nbsp=>1);

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 22:02:54 -08:00
Michał Kiedrowicz
2b34e486bc pack-objects: Fix compilation with NO_PTHREDS
It looks like commit 99fb6e04 (pack-objects: convert to use
parse_options(), 2012-02-01) moved the #ifdef NO_PTHREDS around but
hasn't noticed that the 'arg' variable no longer is available.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 17:46:00 -08:00
Junio C Hamano
8080906245 Merge branch 'maint'
* maint:
  Document accumulated fixes since 1.7.9.2
  Git 1.7.8.5
  grep -P: Fix matching ^ and $
  am: don't infloop for an empty input file
  rebase -m: only call "notes copy" when rewritten exists and is non-empty
  git-p4: remove bash-ism in t9800
  git-p4: remove bash-ism in t9809
  git-p4: fix submit regression with clientSpec and subdir clone
  git-p4: set useClientSpec variable on initial clone
  Makefile: add thread-utils.h to LIB_H

Conflicts:
	RelNotes
	t/t9809-git-p4-client-view.sh
2012-02-26 17:39:04 -08:00
Junio C Hamano
62ed0728fe Document accumulated fixes since 1.7.9.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 17:08:59 -08:00
Junio C Hamano
660e20f5c7 Merge branch 'jc/add-refresh-unmerged' into maint
* jc/add-refresh-unmerged:
  refresh_index: do not show unmerged path that is outside pathspec
2012-02-26 17:06:23 -08:00
Junio C Hamano
8f2c0995b6 Merge branch 'js/configure-libintl' into maint
* js/configure-libintl:
  configure: don't use -lintl when there is no gettext support
2012-02-26 17:04:53 -08:00
Junio C Hamano
4d06691eec Sync with 1.7.8.5 2012-02-26 16:42:35 -08:00
Junio C Hamano
c524ceb12f Git 1.7.8.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.8.5
2012-02-26 16:40:20 -08:00
Michał Kiedrowicz
fba4f1259d grep -P: Fix matching ^ and $
When "git grep" is run with -P/--perl-regexp, it doesn't match ^ and $ at
the beginning/end of the line.  This is because PCRE normally matches ^
and $ at the beginning/end of the whole text, not for each line, and "git
grep" passes a large chunk of text (possibly containing many lines) to
pcre_exec() and then splits the text into lines.

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

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

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

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

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:32:37 -08:00
Pete Wyckoff
09ccbd34f4 git-p4: remove bash-ism in t9800
This works in both bash and dash:

    $ bash -c 'VAR=1 env' | grep VAR
    VAR=1
    $ dash -c 'VAR=1 env' | grep VAR
    VAR=1

But environment variables assigned this way are not necessarily propagated
through a function in POSIX compliant shells:

    $ bash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR
    VAR=1
    $ dash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR

Fix constructs like this, in particular, setting variables through
test_must_fail.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:20:18 -08:00
Pete Wyckoff
8d93a5ac68 git-p4: remove bash-ism in t9809
Plain old $# works to count the number of arguments in
either bash or dash, even if the arguments have spaces.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:19:22 -08:00