1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-02 07:17:58 +01:00
Commit graph

1404 commits

Author SHA1 Message Date
Junio C Hamano
745ef0625b Merge branch 'fc/completion-tests'
By Felipe Contreras (4) and others
* fc/completion-tests:
  completion: fix completion after 'git --option <TAB>'
  completion: avoid trailing space for --exec-path
  completion: add missing general options
  completion: simplify by using $prev
  completion: simplify __gitcomp_1
  tests: add tests for the __gitcomp() completion helper function
  tests: add initial bash completion tests
2012-04-24 14:41:22 -07:00
Junio C Hamano
4c9d7bc4a6 Merge branch 'pw/git-p4'
By Pete Wyckoff
* pw/git-p4:
  git p4: use "git p4" directly in tests
  git p4: update name in script
  git-p4: move to toplevel
2012-04-23 12:40:03 -07:00
SZEDER Gábor
911d5da6f2 completion: fix completion after 'git --option <TAB>'
The bash completion doesn't work when certain options to git itself are
specified, e.g. 'git --no-pager <TAB>' errors out with

    error: invalid key: alias.--no-pager

The main _git() completion function finds out the git command name by
looping through all the words on the command line and searching for
the first word that is not a known option for the git command.

Unfortunately the list of known git options was not updated in a long
time, and newer options are not skipped but mistaken for a git command.
Such a misrecognized "command" is then passed to __git_aliased_command(),
which in turn passes it to a 'git config' query, hence the error.

Currently the following options are misrecognized for a git command:

  -c --no-pager --exec-path --html-path --man-path --info-path
  --no-replace-objects --work-tree= --namespace=

To fix this we could just update the list of options to be skipped,
but the same issue will likely arise, if the git command learns a new
option in the future.  Therefore, to make it more future proof against
new options, this patch changes that loop to skip all option-looking
words, i.e. words starting with a dash.

We also have to handle the '-c' option specially, because it takes a
configutation parameter in a separate word, which must be skipped,
too.

[fc: added tests]

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-21 22:39:07 -07:00
Jonathan Nieder
3ffcd08688 completion: avoid trailing space for --exec-path
"--exec-path" looks to the completion script like an unambiguous
successful completion, but it is wrong to emit a SP after it as if
declaring that we are done with completion; the user could be trying
to do

	git --exec-path; # print name of helper directory

or

	git --exec-path=/path/to/alternative/helper/dir <subcommand>

so the most helpful thing to do is to leave out the trailing space and
leave it to the operator to type an equal sign or carriage return
according to the situation.

[fc: added tests]

Cc: Andreas Schwab <schwab@linux-m68k.org>
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-21 22:39:07 -07:00
Felipe Contreras
69ef3c0296 completion: add missing general options
And add relevant tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-21 22:39:06 -07:00
Felipe Contreras
3954068128 completion: simplify by using $prev
cword-1 is the previous word ($prev).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-21 22:39:06 -07:00
Felipe Contreras
3bf421ea62 completion: simplify __gitcomp_1
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-21 22:39:06 -07:00
David A. Greene
926b1ec63e Fix git-subtree install instructions
Update the install instructions to reflect the changes for an
integrated git-subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:26:19 -05:00
David A. Greene
311391da90 Use git-subtree test Makefile
Use the Makefile in contrib/subtree/t to run git-subtree tests.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:26:19 -05:00
David A. Greene
c3d884a688 Add subtree test Makefile
Add a Makefile to run subtree tests.  This is largely copied
from the standard test suite with irrelevant targets removed
and some paths altered to account for where subtree tests live.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:26:10 -05:00
David A. Greene
7ff8463dba Install git-subtree from contrib
Build git-subtree in its contrib directory and install from there.
The main Makefile no longer discovers subcommands build in the main
build area so we cannot count on it to install git-subtree.  The user
should make && make install in contrib/subtree to install git-subtree.

Change the rule to install the git-subtree manpage.  The main
Documentation area doesn't directly support installing documentation
from other directories so the user will have to do that from within
contrib/subtree for now.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:26:10 -05:00
David A. Greene
187bc2da5b Use configure settings for git-subtree
Include config.make.autogen in the git-subtree contrib area to pick up
settings for prefix and other such things.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:26:10 -05:00
David A. Greene
5163d476d0 Use project config files
Use project-wide files to process documentation for git-subtree.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:25:58 -05:00
David A. Greene
c96c5383ff Remove unnecessary git-subtree files
Remove various files that simply duplicate functionality already
provided by the main project files.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 22:11:25 -05:00
David A. Greene
603ee0f0c3 Set TEST_DIRECTORY
Set TEST_DIRECTORY to the main git test area.  This allows the
git-subtree out-of-tree tests to run correctly.

Signed-off-by: David A. Greene <greened@obbligato.org>
2012-04-09 20:23:10 -05:00
David A. Greene
634392b262 Add 'contrib/subtree/' from commit 'd3a04e06c77d57978bb5230361c64946232cc346'
git-subtree-dir: contrib/subtree
git-subtree-mainline: e8dde3e5f9
git-subtree-split: d3a04e06c7
2012-04-09 20:22:55 -05:00
Pete Wyckoff
b6f9305764 git-p4: move to toplevel
Move git-p4 out of contrib/fast-import into the main code base,
aside other foreign SCM tools.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-09 14:59:40 -07:00
Jim Meyering
a7793a7491 correct spelling: an URL -> a URL
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-28 08:47:23 -07:00
Junio C Hamano
f47ff5afe4 Merge branch 'am/completion-zsh-fix'
* am/completion-zsh-fix:
  contrib/completion: "local var=()" is misinterpreted as func-decl by zsh
2012-03-23 14:36:21 -07:00
Alex Merry
471dcfdbb2 contrib/completion: "local var=()" is misinterpreted as func-decl by zsh
Certain versions of zsh seems to treat

    local var=()

as a function declaration, rather than an assignment of an empty array,
although its documentation does not suggest that this should be the case.

With zsh 4.3.15 on Fedora Core 15, this causes

  __git_ps1 " (%s)"

to trigger an error message:

  local:2: command not found: svn_url_pattern

when GIT_PS1_SHOWUPSTREAM="auto".

Signed-off-by: Alex Merry <dev@randomguy3.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-21 10:02:39 -07:00
Junio C Hamano
a99c5e5921 Merge branch 'th/git-diffall'
* th/git-diffall:
  contrib/diffall: fix cleanup trap on Windows
  contrib/diffall: eliminate duplicate while loops
  contrib/diffall: eliminate use of tar
  contrib/diffall: create tmp dirs without mktemp
  contrib/diffall: comment actual reason for 'cdup'
2012-03-15 21:54:42 -07:00
Tim Henigan
bfe392e367 contrib/diffall: fix cleanup trap on Windows
Prior to this commit, the cleanup trap that removes the tmp dir
created by the script would fail on Windows. The error was silently
ignored by the script.

On Windows, a directory cannot be removed while it is the working
directory of the process (thanks to Johannes Sixt on the Git list
for this info [1]).

This commit eliminates the 'cd' into the tmp directory that caused
the error.

[1]: http://article.gmane.org/gmane.comp.version-control.git/193086

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:22:38 -07:00
Tim Henigan
97549084f6 contrib/diffall: eliminate duplicate while loops
There were 3 instances of a 'while read; do' that used identical logic
to populate '/tmp/right_dir'. This commit groups them into a single loop.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:22:08 -07:00
Tim Henigan
e33e01d077 contrib/diffall: eliminate use of tar
The 'tar' utility is not available on all platforms (some only support
'gnutar').  An earlier commit created a work-around for this problem,
but a better solution is to eliminate the use of 'tar' completely.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:20:25 -07:00
Tim Henigan
c5770f7906 contrib/diffall: create tmp dirs without mktemp
mktemp is not available on all platforms.  Instead of littering the code
with a work-around, this commit replaces mktemp with a one-line Perl
script.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:20:21 -07:00
Tim Henigan
a22a9477fc contrib/diffall: comment actual reason for 'cdup'
The comment from an earlier commit did not reflect the actual reason this
operation is needed.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-14 15:19:55 -07:00
Junio C Hamano
af050219e4 Merge branch 'zj/diff-stat-dyncol'
By Zbigniew Jędrzejewski-Szmek (8) and Junio C Hamano (1)
* zj/diff-stat-dyncol:
  : This breaks tests. Perhaps it is not worth using the decimal-width stuff
  : for this series, at least initially.
  diff --stat: add config option to limit graph width
  diff --stat: enable limiting of the graph part
  diff --stat: add a test for output with COLUMNS=40
  diff --stat: use a maximum of 5/8 for the filename part
  merge --stat: use the full terminal width
  log --stat: use the full terminal width
  show --stat: use the full terminal width
  diff --stat: use the full terminal width
  diff --stat: tests for long filenames and big change counts
2012-03-06 14:53:06 -08:00
Junio C Hamano
260eb7e389 Merge branch 'th/git-diffall'
* th/git-diffall:
  contrib: add git-diffall script
2012-03-01 20:59:25 -08:00
Zbigniew Jędrzejewski-Szmek
df44483a5d diff --stat: add config option to limit graph width
Config option diff.statGraphWidth=<width> is equivalent to
--stat-graph-width=<width>, except that the config option is ignored
by format-patch.

For the graph-width limiting to be usable, it should happen
'automatically' once configured, hence the config option.
Nevertheless, graph width limiting only makes sense when used on a
wide terminal, so it should not influence the output of format-patch,
which adheres to the 80-column standard.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-01 09:15:58 -08:00
Junio C Hamano
472fdee793 Merge branch 'pj/completion-remote-set-url-branches'
* pj/completion-remote-set-url-branches:
  completion: normalize increment/decrement style
  completion: remote set-* <name> and <branch>
2012-02-28 13:26:04 -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
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
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
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
Pete Wyckoff
543987bd47 git-p4: fix submit regression with clientSpec and subdir clone
When the --use-client-spec is given to clone, and the clone
path is a subset of the full tree as specified in the client,
future submits will go to the wrong place.

Factor out getClientSpec() so both clone/sync and submit can
use it.  Introduce getClientRoot() that is needed for the client
spec case, and use it instead of p4Where().

Test the five possible submit behaviors (add, modify, rename,
copy, delete).

Reported-by: Laurent Charrière <lcharriere@promptu.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:14:29 -08:00
Pete Wyckoff
a93d33ee7b git-p4: set useClientSpec variable on initial clone
If --use-client-spec was given, set the matching configuration
variable.  This is necessary to ensure that future submits
work properly.

The alternatives of requiring the user to set it, or providing
a command-line option on every submit, are error prone.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-26 16:14:20 -08:00
Junio C Hamano
d065f68745 Merge branch 'ld/git-p4-expanded-keywords'
* ld/git-p4-expanded-keywords:
  : Teach git-p4 to unexpand $RCS$-like keywords that are embedded in
  : tracked contents in order to reduce unnecessary merge conflicts.
  git-p4: add initial support for RCS keywords
2012-02-23 13:30:31 -08:00
Luke Diamand
60df071c6c git-p4: add initial support for RCS keywords
RCS keywords cause problems for git-p4 as perforce always
expands them (if +k is set) and so when applying the patch,
git reports that the files have been modified by both sides,
when in fact they haven't.

This change means that when git-p4 detects a problem applying
a patch, it will check to see if keyword expansion could be
the culprit. If it is, it strips the keywords in the p4
repository so that they match what git is expecting. It then
has another go at applying the patch.

This behaviour is enabled with a new git-p4 configuration
option and is off by default.

Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-23 13:25:35 -08:00
Junio C Hamano
f1f1b96e99 Sync with 1.7.9.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 17:49:02 -08:00
Philip Jägenstedt
6e8c755fd3 completion: normalize increment/decrement style
The style used for incrementing and decrementing variables was fairly
inconsistenty and was normalized to use x++, or ((x++)) in contexts
where the former would otherwise be interpreted as a command. This is a
bash-ism, but for obvious reasons this script is already bash-specific.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 13:59:58 -08:00
Philip Jägenstedt
f1c6ffe684 completion: remote set-* <name> and <branch>
Complete <name> only for set-url. For set-branches and
set-head, complete <name> and <branch> over the network,
like e.g. git pull already does.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 13:59:55 -08:00
Philip Jägenstedt
514a529d25 completion: use tabs for indentation
CodingGuidlines confidently declares "We use tabs for indentation."
It would be a shame if it were caught lying.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 13:57:38 -08:00
Philip Jägenstedt
176158cabd completion: remove stale "to submit patches" documentation
It was out-of-sync with the reality of who works on this
script. Defer (silently) to Documentation/SubmittingPatches
like all other code.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 13:57:05 -08:00
Russell Myers
41799aa209 git-p4: the option to specify 'host' is -H, not -h
This was broken since the feature was introduced initially at abcaf07 (If
the user has configured various parameters, use them., 2008-08-10).

Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-02-22 11:18:19 -08:00
Junio C Hamano
675fff45a7 Merge branch 'master' of git://bogomips.org/git-svn
* 'master' of git://bogomips.org/git-svn:
  git-svn.perl: fix a false-positive in the "already exists" test
  git-svn.perl: perform deletions before anything else
  git-svn: Fix time zone in --localtime
  git-svn: un-break "git svn rebase" when log.abbrevCommit=true
  git-svn: remove redundant porcelain option to rev-list
  completion: add --interactive option to git svn dcommit
2012-02-21 18:11:31 -08:00
Junio C Hamano
d30146ac5f Merge branch 'jk/diff-highlight'
* jk/diff-highlight:
  diff-highlight: document some non-optimal cases
  diff-highlight: match multi-line hunks
  diff-highlight: refactor to prepare for multi-line hunks
  diff-highlight: don't highlight whole lines
  diff-highlight: make perl strict and warnings fatal
2012-02-21 15:25:39 -08:00
Junio C Hamano
887c409a7a Merge branch 'maint'
* maint:
  Update draft release notes to 1.7.9.2
  completion: Allow dash as the first character for __git_ps1
2012-02-21 15:18:00 -08:00
Junio C Hamano
014578e0d0 Merge branch 'fc/zsh-completion' into maint
* fc/zsh-completion:
  completion: simplify __gitcomp and __gitcomp_nl implementations
  completion: use ls -1 instead of rolling a loop to do that ourselves
  completion: work around zsh option propagation bug
2012-02-21 14:55:50 -08:00
Frederic Heitzmann
7b151f492d completion: add --interactive option to git svn dcommit
see afd7f1e for more details on git svn dcommit --interactive

Signed-off-by: Frederic Heitzmann <frederic.heitzmann@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2012-02-21 21:37:31 +00:00