1
0
mirror of https://github.com/git/git.git synced 2024-10-21 01:08:11 +02:00
Commit Graph

917 Commits

Author SHA1 Message Date
Marius Storm-Olsen
ddb6d01023 Fixup: Add bare repository indicator for __git_ps1
Signed-off-by: Marius Storm-Olsen <git@storm-olsen.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-24 21:45:04 -08:00
Marius Storm-Olsen
f50edca56c Add bare repository indicator for __git_ps1
Prefixes the branch name with "BARE:" if you're in a
bare repository.

Signed-off-by: Marius Storm-Olsen <git@storm-olsen.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23 15:23:39 -08:00
Ted Pavlic
5c9cc64a4a completion: More fixes to prevent unbound variable errors
Several functions make use of "[-n ...]" and "[-z ...]". In many cases,
the variables being tested were declared with "local."

However, several __variables are not, and so they must be replaced with
their ${__-} equivalents.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11 11:09:17 -08:00
Ted Pavlic
e5dd864adf completion: Better __git_ps1 support when not in working directory
If .git/HEAD is not readable, __git_ps1 does nothing.

If --is-in-git-dir, __git_ps1 returns " (GIT_DIR!)" as a cautionary
note. The previous behavior would show the branch name (and would
optionally attempt to determine the dirtyState of the directory, which
was impossible because a "git diff" was used).

If --is-in-work-tree, __git_ps1 returns the branch name. Additionally,
if showDirtyState is on, the dirty state is displayed.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11 11:09:16 -08:00
Ted Pavlic
ad244d2568 completion: Use consistent if [...] convention, not "test"
The local coding convention in bash completion is to use [...] rather
than test. Additionally,

    if [...]; then

is preferred over

    if [...]
    then

and so matching "if [...]\nthen" were changed accordingly.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11 11:09:16 -08:00
Ted Pavlic
fa26a401be completion: For consistency, change "git rev-parse" to __gitdir calls
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11 11:09:16 -08:00
Ted Pavlic
a9ee90d7ff completion: Get rid of tabbed indentation in comments. Replace with spaces.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-08 22:07:49 -08:00
Ted Pavlic
cf9957875c completion: Fix GIT_PS1_SHOWDIRTYSTATE to prevent unbound variable errors.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-08 22:07:46 -08:00
Alexandre Julliard
7851386948 emacs: Remove the no longer maintained vc-git package.
vc-git is distributed with Emacs since version 22.2, and is maintained
in the Emacs CVS tree. This file is obsolete and causes trouble for
people who want to add contrib/emacs to their load-path.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 15:14:27 +01:00
Alexandre Julliard
5a7b3bf527 git.el: Add some notes about Emacs versions compatibility.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 15:14:22 +01:00
Alexandre Julliard
6c4f70d5b2 git.el: Use integer instead of character constants in case statement.
This is for compatibility with XEmacs. Reported by Vassili Karpov.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 14:01:44 +01:00
Alexandre Julliard
efd49f50fc git.el: Set a regexp for paragraph-separate in log-edit mode.
This allows using fill-paragraph on the log message without
interference from the various header fields.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard
a7da5c4259 git.el: Make git-run-command-region display the error if any.
This makes it easier to figure out why a commit has failed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard
ab69e3e43a git.el: Add commands for cherry-pick and revert.
Support for cherry-picking and reverting commits, with automatic
formatting of the commit log message. Bound to C-c C-p and C-c C-v
respectively.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard
811b10c746 git.el: Add a command to create a new branch.
Prompts for a branch name, create a new branch at HEAD and switch to
it. Bound to C-c C-b by default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:54 +01:00
Alexandre Julliard
c375e9d04c git.el: Add a checkout command.
Prompts for a branch name and checks it out. Bound to C-c C-o by
default.

Based on a patch by Rémi Vanicat <vanicat@debian.org>.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-07 13:48:48 +01:00
Thomas Rast
e1ff064e1b contrib git-resurrect: find traces of a branch name and resurrect it
Add a tool 'git-resurrect.sh <branch>' that tries to find traces of
the <branch> in the HEAD reflog and, optionally, all merge commits in
the repository.  It can then resurrect the branch, pointing it at the
most recent of all candidate commits found.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-04 15:07:49 -08:00
Thomas Rast
738a94a9f6 bash: offer to show (un)staged changes
Add a bit of code to __git_ps1 that lets it append '*' to the branch
name if there are any unstaged changes, and '+' if there are any
staged changes.

Since this is a rather expensive operation and will force a lot of
data into the cache whenever you first enter a repository, you have to
enable it manually by setting GIT_PS1_SHOWDIRTYSTATE to a nonempty
value.  The configuration variable bash.showDirtyState can then be
used to disable it again for some repositories.

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-02-03 22:07:51 -08:00
David Aguilar
99ccabaffa contrib/difftool: Don't repeat merge tool candidates
git difftool listed some candidates for mergetools twice, depending on
the environment.

This slightly changes the behavior when both KDE_FULL_SESSION and
GNOME_DESKTOP_SESSION_ID are set at the same time; in such a case
meld is used in favor of kdiff3 (the old code favored kdiff3 in such a
case), but it should not matter in practice.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31 17:35:06 -08:00
Markus Heidelberg
384770a5e7 contrib/difftool: add support for Kompare
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-31 17:34:58 -08:00
Junio C Hamano
5dc1308562 Merge branch 'js/patience-diff'
* js/patience-diff:
  bash completions: Add the --patience option
  Introduce the diff option '--patience'
  Implement the patience diff algorithm

Conflicts:
	contrib/completion/git-completion.bash
2009-01-23 21:51:38 -08:00
Markus Heidelberg
f135e72d61 bash completion: add 'rename' subcommand to git-remote
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-21 12:23:23 -08:00
Markus Heidelberg
bc08fc4e85 contrib/difftool: remove distracting 'echo' in the SIGINT handler
When interrupting git-difftool with Ctrl-C, the output of this echo
command led to having the cursor at the beginning of the line below the
shell prompt.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19 22:39:19 -08:00
Markus Heidelberg
f13bfc1be7 contrib/difftool: change trap condition from SIGINT to INT
git-difftool worked for me on an up-to-date Gentoo Linux at home, but
didn't work on a somewhat older Ubuntu Linux 7.10 at work and failed
with the following error, where 'Makefile' was locally modified:

    trap: 244: SIGINT: bad trap
    external diff died, stopping at Makefile.

In 'man 1p trap' there is written:

    "The condition can be EXIT, 0 (equivalent to EXIT), or a signal
    specified using a symbolic name, without the SIG prefix, [...]"

    "Implementations may permit names with the SIG prefix or ignore case
    in signal names as an extension."

So now we do it the POSIX compliant way instead of using an extension.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19 22:39:15 -08:00
Thomas Rast
20bf729231 bash completion: refactor diff options
diff, log and show all take the same diff options.  Refactor them from
__git_diff and __git_log into a variable, and complete them in
__git_show too.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19 15:21:00 -08:00
Thomas Rast
47d5a8fa71 bash completion: move pickaxe options to log
Move the options --pickaxe-all and --pickaxe-regex to git-log, where
they make more sense than with git-diff.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-19 15:16:24 -08:00
David Aguilar
28da86a58d difftool: put the cursor on the editable file for Vim
You only need to edit worktree files when comparing against
the worktree.  Put the cursor automatically into its window for
vimdiff and gvimdiff to avoid doing <C-w>l every time.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18 22:44:17 -08:00
David Aguilar
507cfcbd81 difftool: fix documentation problems
This patch makes the difftool docs always refer to the
git-difftool script using the dashed form of the name.
Only command examples use the non-dashed form now.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18 22:44:13 -08:00
Pete Harlan
e82f0d73f0 git-svn: Add --localtime option to "fetch"
By default git-svn stores timestamps of fetched commits in
Subversion's UTC format.  Passing --localtime to fetch will convert
them to the timezone of the server on which git-svn is run.

This makes the timestamps of a resulting "git log" agree with what
"svn log" shows for the same repository.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
2009-01-18 15:38:28 -08:00
David Aguilar
5c38ea31f3 contrib: add 'git difftool' for launching common merge tools
'git difftool' is a git command that allows you to compare and edit files
between revisions using common merge tools.  'git difftool' does what
'git mergetool' does but its use is for non-merge situations such as
when preparing commits or comparing changes against the index.
It uses the same configuration variables as 'git mergetool' and
provides the same command-line interface as 'git diff'.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 21:40:57 -08:00
SZEDER Gábor
3d279863de bash: refactor 'git log --pretty=<format>' options
Both 'git log' and 'show' have the same '--pretty=<format>' option
with the same formats.  So refactor these formats into a common
variable.

While at it, also add 'format:' to the list.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 18:23:27 -08:00
SZEDER Gábor
8108513422 bash: add missing format-patch command line options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 18:22:46 -08:00
SZEDER Gábor
7de931c3c2 bash: remove unnecessary checks for long options with argument
__gitcomp takes care of it since 5447aac7 (bash: fix long option with
argument double completion, 2008-03-05)

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-17 18:22:21 -08:00
Ted Pavlic
a42577d4c8 bash-completion: Add comments to remind about required arguments
Add a few simple comments above commands that take arguments. These
comments are meant to remind developers of potential problems that
can occur when the script is sourced on systems with "set -u." Any
function which requires arguments really ought to be called with
explicit arguments given.

Also adds a #!bash to the top of bash completions so that editing
software can always identify that the file is of sh type.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 09:35:46 -08:00
Ted Pavlic
50e126e185 bash-completion: Try bash completions before simple filetype
When a git completion is not found, a bash shell should try bash-type
completions first before going to standard filetype completions. This
patch adds "-o bashdefault" to the completion line. If that option is
not available, it uses the old method.

This behavior was inspired by Mercurial's bash completion script.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 09:34:54 -08:00
Ted Pavlic
25a31f8140 bash-completion: Support running when set -u is enabled
Under "set -u" semantics, it is an error to access undefined variables.
Some user environments may enable this setting in the interactive shell.

In any context where the completion functions access an undefined
variable, accessing a default empty string (aka "${1-}" instead of "$1")
is a reasonable way to code the function, as it silences the undefined
variable error while still supplying an empty string.

In this patch, functions that should always take an argument still use
$1. Functions that have optional arguments use ${1-}.

Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15 09:33:26 -08:00
Junio C Hamano
3ea95d2b0e Merge branch 'maint'
* maint:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files
2009-01-13 01:25:55 -08:00
Junio C Hamano
1cbe69f649 Merge branch 'maint-1.6.0' into maint
* maint-1.6.0:
  Avoid spurious error messages on error mistakes.
  contrib/examples/README: give an explanation of the status of these files
2009-01-13 00:40:19 -08:00
Markus Heidelberg
abc776f788 contrib/vim: change URL to point to the latest syntax files
Vim's SVN repository doesn't offer the latest runtime files, since
normally they are only updated there on a release. Though currently
there is no difference between the SVN and HTTP/FTP version of the git
syntax files.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-12 23:36:03 -08:00
jidanni@jidanni.org
47a845bfc3 contrib/examples/README: give an explanation of the status of these files
We attempt to give an explanation of the status of the files in this
directory.

Signed-off-by: jidanni <jidanni@jidanni.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-12 17:47:36 -08:00
Lee Marlow
df3987717f bash completion: Use 'git add' completions for 'git stage'
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10 17:37:58 -08:00
Lee Marlow
c9a114b591 bash completion: Add '--intent-to-add' long option for 'git add'
Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-10 17:37:58 -08:00
Johannes Schindelin
cc54570925 bash completions: Add the --patience option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-07 13:37:07 -08:00
Junio C Hamano
7bb5321be0 Merge branch 'rs/diff-ihc'
* rs/diff-ihc:
  diff: add option to show context between close hunks

Conflicts:
	Documentation/diff-options.txt
2009-01-07 00:10:14 -08:00
SZEDER Gábor
e89e2ed7c2 bash: add '--merge' to 'git reset'
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-05 10:55:27 -08:00
René Scharfe
6d0e674a57 diff: add option to show context between close hunks
Merge two hunks if there is only the specified number of otherwise unshown
context between them.  For --inter-hunk-context=1, the resulting patch has
the same number of lines but shows uninterrupted context instead of a
context header line in between.

Patches generated with this option are easier to read but are also more
likely to conflict if the file to be patched contains other changes.

This patch keeps the default for this option at 0.  It is intended to just
make the feature available in order to see its advantages and downsides.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-29 01:05:21 -08:00
Richard Hartmann
f66bc5f928 Always show which directory is not a git repository
Unify all

  fatal: Not a git repository

error messages so they include path information.

Signed-off-by: Richard Hartmann <richih@net.in.tum.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-21 18:46:41 -08:00
Lee Marlow
98171a07ae bash completion: Sync config variables with their man pages
Add 'normal' to config color options.
Add 'mergeoptions' to branch config options.
Add 'proxy' and 'mirror' to remote config options.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-15 23:06:17 -08:00
Lee Marlow
025a19298d bash completion: Sort config completion variables
Sort the config variables to make sync-ing them with
Documents/config.txt easier in the future.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-15 23:06:17 -08:00
Tor Arvid Lund
75bc9573b0 git-p4: Fix regression in p4Where method.
Unfortunately, I introduced a bug in commit 7f705dc36 (git-p4: Fix bug in
p4Where method). This happens because sometimes the result from
"p4 where <somepath>" doesn't contain a "depotFile" key, but instead a
"data" key that needs further parsing. This commit should ensure that both
of these cases are checked.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-09 21:39:16 -08:00