Commit graph

1064 commits

Author SHA1 Message Date
David Aguilar afcbc8e7ec difftool: move 'git-difftool' out of contrib
This prepares 'git-difftool' and its documentation for
mainstream use.

'git-difftool-helper' became 'git-difftool--helper'
since users should not use it directly.

'git-difftool' was added to the list of commands as
an ancillaryinterrogator.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:56 -07:00
Sebastian Pipping 1c0f3d224e difftool/mergetool: add diffuse as merge and diff tool
This adds diffuse as a built-in merge tool.

Signed-off-by: Sebastian Pipping <sebastian@pipping.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:56 -07:00
David Aguilar 8b7332221d difftool: add a -y shortcut for --no-prompt
This is another consistency cleanup to make git-difftool's options
match git-mergetool.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:55 -07:00
David Aguilar 46ae156d6c difftool: use perl built-ins when testing for msys
I don't even know what $COMSPEC means so let's be safe and use the
same perly $^O test add--interactive uses.  While we're at it, make
git-difftool match the prevalent git-perl style.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:55 -07:00
David Aguilar 2e8af7e42b difftool: remove the backup file feature
Most users find the backup file feature annoying and there's no
need for it since diff is supposed to be a read-only operation.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:55 -07:00
David Aguilar 76ca653842 difftool: remove merge options for opendiff, tkdiff, kdiff3 and xxdiff
We shouldn't try to merge files when using difftool, so remove
any merge-specific options.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:55 -07:00
Markus Heidelberg bad4273200 git-mergetool/difftool: make (g)vimdiff workable under Windows
Under Windows vimdiff and gvimdiff are not available as symbolic links,
but as batch files vimdiff.bat and gvimdiff.bat. These files weren't
found by 'type vimdiff' which led to the following error:

    The merge tool vimdiff is not available as 'vimdiff'

Even if they were found, it wouldn't work to invoke these batch files
from git-mergetool.

To solve this, use vim and gvim (vim.exe and gvim.exe) and pass the -d
command line switch over to them.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-07 22:19:55 -07:00
Todd Zullinger 43acdf243e bash completion: Update 'git am' options
This adds --committer-date-is-author-date, --ignore-date, and --no-utf8
options.  The --binary option is removed, as it was made a no-op by
cb3a160.  The option list is also sorted alphabetically.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-05 12:04:22 -07:00
Markus Heidelberg 89a56bfbd3 add --html-path to get the location of installed HTML docs
This can be used in GUIs to open installed HTML documentation in the
browser.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-04-04 23:57:59 -07:00
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 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
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
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
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
Stephen Boyd e1d37937ac completion: add --thread=deep/shallow to format-patch
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Trivially-Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24 19:17:33 -07:00
Stephen Boyd 3f7df3a71a completion: add --cc and --no-attachment option to format-patch
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Trivially-Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24 19:17:33 -07:00
Stephen Boyd 77813151f9 completion: add --annotate option to send-email
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Trivially-Acked-By: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-24 19:17:33 -07:00
Arto Jonsson 4bca86367b bash completion: add options for 'git fsck'
Signed-off-by: Arto Jonsson <ajonsson@kapsi.fi>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-22 17:41:57 -07:00
Kevin McConnell ebd15bf0d7 Add --staged to bash completion for git diff
The --staged option (synonym for --cached) isn't listed in the
completion choices for git diff.  This tiny patch adds it.

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-22 17:41:46 -07:00
Giuseppe Bilotta 6872f606d9 import-tars: separate author from committer
The import-tars script is typically employed to (re)create the past
history of a project from stored tars. Although assigning authorship in
these cases can be a somewhat arbitrary process, it makes sense to set
the author to whoever created the tars in the first place (if it's
known), and (s)he can in general be different from the committer
(whoever is running the script).

Implement this by having separate author and committer data, making them
settable from the usual GIT_* environment variables.

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-20 09:33:28 -07:00
Junio C Hamano ca8a36e6e0 Merge branch 'js/remote-improvements'
* js/remote-improvements: (23 commits)
  builtin-remote.c: no "commented out" code, please
  builtin-remote: new show output style for push refspecs
  builtin-remote: new show output style
  remote: make guess_remote_head() use exact HEAD lookup if it is available
  builtin-remote: add set-head subcommand
  builtin-remote: teach show to display remote HEAD
  builtin-remote: fix two inconsistencies in the output of "show <remote>"
  builtin-remote: make get_remote_ref_states() always populate states.tracked
  builtin-remote: rename variables and eliminate redundant function call
  builtin-remote: remove unused code in get_ref_states
  builtin-remote: refactor duplicated cleanup code
  string-list: new for_each_string_list() function
  remote: make match_refs() not short-circuit
  remote: make match_refs() copy src ref before assigning to peer_ref
  remote: let guess_remote_head() optionally return all matches
  remote: make copy_ref() perform a deep copy
  remote: simplify guess_remote_head()
  move locate_head() to remote.c
  move duplicated ref_newer() to remote.c
  move duplicated get_local_heads() to remote.c
  ...

Conflicts:
	builtin-clone.c
2009-03-17 18:55:06 -07:00
David Aguilar 2464456a6a contrib/difftool: use a separate config namespace for difftool commands
Some users have different mergetool and difftool settings, so teach
difftool to read config vars from the difftool.* namespace.  This allows
having distinct configurations for the diff and merge scenarios.

We don't want to force existing users to set new values for no reason
so difftool falls back to existing mergetool config variables when the
difftool equivalents are not defined.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-11 21:54:59 -07:00
Pete Wyckoff 3b167396b4 git-p4: remove tabs from usermap file
Some users have tabs in their names, oddly enough.  This
causes problems when loading the usercache from disk,
as split separates the fields on the wrong tabs.  When
fast-import's parse_ident() tries to parse the committer
field, it is unhappy about the unbalanced <..> angle brackets.

It is easy enough to convert the tabs to single spaces.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-07 20:32:07 -08:00
Jay Soffian 0a4e14727f bash completion: teach fetch, pull, and push to complete their options
fetch, pull, and push didn't know their options. They do now. merge's
options are factored into a variable so they can be shared between
_git_merge and _git_pull

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-07 20:23:28 -08:00
Jay Soffian 3c7b480a1c bash completion: refactor --strategy completion
The code to complete --strategy was duplicated between _git_rebase and
_git_merge, and is about to gain a third caller (_git_pull). This patch
factors it into its own function.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-07 20:23:09 -08:00
Jay Soffian 52d5c3b5b2 bash completion: fix completion issues with fetch, pull, and push
Sverre Rabbelier noticed a completion issue with push:

 $ git push ori<tab>
 git push origin

 $ git push -f ori<tab>
 git push -f origin/

Markus Heidelberg pointed out that the issue extends to fetch and pull.

The reason is that the current code naively assumes that if
COMP_CWORD=2, it should complete a remote name, otherwise it should
complete a refspec. This assumption fails if there are any --options.

This patch fixes that issue by instead scanning COMP_CWORDS to see if
the remote has been completed yet (we now assume the first non-dashed
argument is the remote). The new logic is factored into a function,
shared by fetch, pull, and push.

The new function also properly handles '.' as the remote.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-03-07 20:19:45 -08:00
Junio C Hamano 458eaf5bf8 Merge branch 'ns/pretty-format'
* ns/pretty-format:
  bash completion: add --format= and --oneline options for "git log"
  Add tests for git log --pretty, --format and --oneline.
  Add --oneline that is a synonym to "--pretty=oneline --abbrev-commit"
  Give short-hands to --pretty=tformat:%formatstring
  Add --format that is a synonym to --pretty
2009-03-05 15:41:43 -08:00
Junio C Hamano 229e65823a Merge branch 'tp/completion'
* tp/completion:
  Fixup: Add bare repository indicator for __git_ps1
  Add bare repository indicator for __git_ps1
  completion: More fixes to prevent unbound variable errors
  completion: Better __git_ps1 support when not in working directory
  completion: Use consistent if [...] convention, not "test"
  completion: For consistency, change "git rev-parse" to __gitdir calls
2009-03-05 15:41:39 -08:00
Jay Soffian bc14fac825 builtin-remote: add set-head subcommand
Provide a porcelain command for setting and deleting
$GIT_DIR/remotes/<remote>/HEAD.

While we're at it, document what $GIT_DIR/remotes/<remote>/HEAD is all
about.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-27 15:19:09 -08:00
Teemu Likonen 72de29c24f bash completion: add --format= and --oneline options for "git log"
We also add --format= completion for "git show".

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-27 11:17:44 -08:00
Michael J Gruber 3dbe1165e9 Fix typo in contrib/examples/git-svnimport.txt
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-25 08:33:14 -08:00
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
Abhijit Menon-Sen 3ca9364222 Convert git-* invocations to "git *" in the svnimport example.
After these changes, git-svnimport worked fine for me.

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-24 21:10:57 -08:00
Pete Wyckoff b4b0ba06f8 git-p4: avoid syncing duplicate changes
When a particular changeset affects multiple depot paths, it
will appear multiple times in the output of "p4 changes".
Filter out the duplicates to avoid the extra empty commits that
this otherwise would create.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-23 15:24:08 -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
Alexandre Julliard 6f3c504b54 Add a README in the contrib/emacs directory.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-21 13:57:53 +01:00
Alexandre Julliard 5b4e44104e git.el: Improve the confirmation message on remove and revert.
If there's only one file, print its name instead of just "1 file".

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-21 13:49:44 +01:00
Alexandre Julliard 21ba0e8435 git.el: Make sure that file lists are sorted as they are created.
This avoids a possibly redundant sort in git-update-status-files and
git-status-filenames-map, and allows callers to continue using the
list without having to copy it.

It also fixes the confusing success messages reported by Brent
Goodrick.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2009-02-21 13:49:36 +01:00
Thomas Rast bf3c20f6e8 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-02-18 10:41:45 -08:00
Thomas Rast a393777ec9 bash completion: refactor common log, shortlog and gitk options
Refactor options that are useful for more than one of them into a
variable used by the relevant completions.  This has the effect of
adding the following options to git-log:

  --branches --tags --remotes --first-parent --dense --sparse
  --simplify-merges --simplify-by-decoration --first-parent
  --no-merges

The following to git-shortlog:

  --branches --tags --remotes --first-parent

And the following to gitk:

  --branches --tags --remotes --first-parent --no-merges --max-count=
  --max-age= --since= --after= --min-age= --until= --before= --dense
  --sparse --full-history --simplify-merges --simplify-by-decoration
  --left-right

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-18 10:41:37 -08:00
SZEDER Gábor 4a5856cb24 bash: update 'git svn' options
'git svn' got some new subcommands and otions in the last couple of
months.  This patch adds completion support for them.

In particular:

  * 'fetch', 'clone', etc.: '--ignore-paths='
  * 'init' and 'clone': '--prefix=', '--use-log-author',
                        '--add-author-from'
  * 'dcommit': '--commit-url', '--revision'
  * 'log': '--color'
  * 'rebase': '--dry-run'
  * 'branch', 'tag', 'blame', 'migrate' subcommands and their 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-02-16 14:53:06 -08:00
SZEDER Gábor d532ebd5a7 bash: add missing 'git merge' options
Namely: '--commit', '--stat', '--no-squash', '--ff', '--no-ff'.

One might wonder why add options that specify the default behaviour
anyway (e.g. '--commit', '--no-squash', etc.).  Users can override the
default with config options (e.g. 'branch.<name>.mergeoptions',
'merge.log'), but sometimes might still need the default behaviour.

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-02-16 14:51:24 -08:00
SZEDER Gábor 48c9ab78f3 bash: fix misspelled 'git svn' option
'--user-log-author' -> '--use-log-author'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-14 21:31:16 -08:00
Matt Kraai 901d615c5d bash-completion: Complete the values of color.interactive, color.ui, color.pager
Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-13 09:55:45 -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
Pat Notz e5f5050ed1 Fix contrib/hooks/post-receive-email for new duplicate branch
In the show_new_revisions function, the original code:

  git rev-parse --not --branches | grep -v $(git rev-parse $refname) |

isn't quite right since one can create a new branch and push it
without any new commits.  In that case, two refs will have the same
sha1 but both would get filtered by the 'grep'.  In the end, we'll
show ALL the history which is not what we want.  Instead, we should
list the branches by name and remove the branch being updated and THEN
pass that list through rev-parse.

Revised as suggested by Jakub Narebski and Junio C Hamano to use
git-for-each-ref instead of git-branch.  (Thanks!)

Signed-off-by: Pat Notz <pknotz@sandia.gov>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-02-11 10:38:53 -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
Tor Arvid Lund 7f705dc368 git-p4: Fix bug in p4Where method.
When running:

p4 where //depot/SomePath/...

The result can in some situations look like:

//depot/SomePath/... //client/SomePath/... /home/user/p4root/SomePath/...
-//depot/SomePath/UndesiredSubdir/... //client/SomePath/UndesiredSubdir/... /home/user/p4root/SomePath/UndesiredSubdir/...

This depends on the users Client view. The current p4Where method will now
return /home/user/p4root/SomePath/UndesiredSubdir/... which is not what we
want. This patch loops through the results from "p4 where", and picks the one
where the depotFile exactly matches the given depotPath (//depot/SomePath/...
in this example).

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-12-04 18:44:16 -08:00
Junio C Hamano 455d0f5c23 Merge branch 'maint'
* maint:
  sha1_file.c: resolve confusion EACCES vs EPERM
  sha1_file: avoid bogus "file exists" error message
  git checkout: don't warn about unborn branch if -f is already passed
  bash: offer refs instead of filenames for 'git revert'
  bash: remove dashed command leftovers
  git-p4: fix keyword-expansion regex
  fast-export: use an unsorted string list for extra_refs
  Add new testcase to show fast-export does not always exports all tags
2008-11-27 19:23:51 -08:00
SZEDER Gábor c07838371b bash: offer refs instead of filenames for 'git revert'
The completion script for 'git revert' currently offers options and
filenames.  However, 'git revert' doesn't take any filenames from the
command line, but a single commit.  Therefore, it's more sane to offer
refs instead.

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>
2008-11-27 18:35:07 -08:00
SZEDER Gábor 608efb875f bash: complete full refs
Sometimes it's handy to complete full refs, e.g. the user has some
refs outside of refs/{heads,remotes,tags} or the user wants to
complete some git command's special refs (like 'git show
refs/bisect/bad').

To do that, we check whether the ref to be completed starts with
'refs/' or is 'refs' (to reduce the risk of matching 'refs-').  If it
does, then we offer full refs for completion; otherwise everything
works as usual.

This way the impact on the common case is fairly small (hopefully not
many users have branches or tags starting with 'refs'), and in the
special case the cost of typing out 'refs' is bearable.

While at it, also remove the unused 'cmd' variable from '__git_refs'.

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>
2008-11-27 18:34:30 -08:00
SZEDER Gábor 8d8163f377 bash: remove dashed command leftovers
Commit 5a625b07 (bash: remove fetch, push, pull dashed form leftovers,
2008-10-03) did that already, but there were still some git-cmd left
here and there.

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>
2008-11-27 18:29:53 -08:00
Pete Wyckoff 3d51c853df git-p4: fix keyword-expansion regex
This text:

     my $dir = $File::Find::dir;
     return if ($dir !~ m,$options->{dirpat}$,);

was improperly converted to:

     my $dir = $File$dir !~ m,$options->{dirpat}$,);

by the keyword identifier expansion code.  Add a \n
to make sure the regex doesn't go across end-of-line
boundaries.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-27 13:17:58 -08:00
Alexandre Julliard 1905a8666a git.el: Allow to commit even if there are no marked files.
This can be useful to commit a merge that didn't result in any
changes.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-23 11:54:42 +01:00
Alexandre Julliard c4e8b72f22 git.el: Add possibility to mark files directly in git-update-status-files.
This avoids the need to go through the list twice, which helps
performance on large file lists.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-23 11:54:41 +01:00
Alexandre Julliard b0a53e9e56 git.el: Add an insert file command.
This allows to insert a file in the buffer no matter what its state
is, making it possible for instance to remove an up-to-date file.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-23 11:54:38 +01:00
Alexandre Julliard 433ee03f97 git.el: Never clear the status buffer, only update the files.
This makes it unnecessary to save/restore the file marks.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:33 +01:00
Alexandre Julliard db18a182a2 git.el: Fix git-amend-commit to support amending an initial commit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:03 +01:00
Alexandre Julliard ef5133df7c git.el: Properly handle merge commits in git-amend-commit.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:03 +01:00
Alexandre Julliard 6fb204266c git.el: Simplify handling of merge heads in the commit log-edit buffer.
Use a single Merge: header instead of one Parent: header for each
parent, and don't list the current HEAD as a merged head. Support
symbolic references too.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:02 +01:00
Alexandre Julliard 9ddf6d7c10 git.el: Remove the env parameter in git-call-process and git-call-process-string.
All callers that need to change the environment now set
process-environment themselves.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:02 +01:00
Alexandre Julliard 36d2078ff1 git.el: Improve error handling for commits.
Display all errors happening in the various subcommands of the commit
sequence, and abort on any error.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2008-11-21 20:39:02 +01:00
John Chapman 36bd844658 git-p4: Cache git config for performance
This makes git-p4 noticibly faster on Windows.

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-11 14:50:03 -08:00
John Chapman 7f96e2e25a git-p4: Support purged files and optimize memory usage
Purged files are handled as if they are merely deleted, which is not
entirely optimal, but I don't know of any other way to handle them.
File data is deleted from memory as early as they can, and they are more
efficiently handled, at (significant) cost to CPU usage.

Still need to handle p4 branches with spaces in their names.
Still need to make git-p4 clone more reliable.
 - Perhaps with a --continue option. (Sometimes the p4 server kills
 the connection)

Signed-off-by: John Chapman <thestar@fussycoder.id.au>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-11 14:50:03 -08:00
Pete Harlan b0a7d11173 contrib/hooks/post-receive-email: Make revision display configurable
Add configuration option hooks.showrev, letting the user override how
revisions will be shown in the commit email.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-04 14:43:16 -08:00
Pete Harlan 4471649f44 contrib/hooks/post-receive-email: Put rev display in separate function
The display of a revision in an email-appropriate format is done in
two places with similar code.  In preparation for making that display
more complex, move it into a separate function that handles both cases.

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-04 14:43:07 -08:00
Junio C Hamano 933bb3ae5e Merge branch 'maint'
* maint:
  git-svn: change dashed git-commit-tree to git commit-tree
  Documentation: clarify information about 'ident' attribute
  bash completion: add doubledash to "git show"
  Use test-chmtime -v instead of perl in t5000 to get mtime of a file
  Add --verbose|-v to test-chmtime
  asciidoc: add minor workaround to add an empty line after code blocks
  Plug a memleak in builtin-revert
  Add file delete/create info when we overflow rename_limit
  Install git-cvsserver in $(bindir)
  Install git-shell in bindir, too
2008-10-31 01:42:58 -07:00
Markus Heidelberg 41d8cf7d7f bash completion: add doubledash to "git show"
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-31 00:46:27 -07:00
Lee Marlow 99f0b59954 bash completion: Add 'workflows' to 'git help'
Completion for new workflow documentation introduced in f948dd8

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-20 23:39:28 -07:00
Junio C Hamano 58e0fa5416 Merge branch 'maint'
* maint:
  Hopefully the final draft release notes update before 1.6.0.3
  diff(1): clarify what "T"ypechange status means
  contrib: update packinfo.pl to not use dashed commands
  force_object_loose: Fix memory leak
  tests: shell negation portability fix
2008-10-18 08:26:44 -07:00
Dan McGee 3b1eb12493 contrib: update packinfo.pl to not use dashed commands
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-18 06:20:27 -07:00
Junio C Hamano 46dc1b0e33 Merge branch 'maint'
* maint:
  t1301-shared-repo.sh: don't let a default ACL interfere with the test
  git-check-attr(1): add output and example sections
  xdiff-interface.c: strip newline (and cr) from line before pattern matching
  t4018-diff-funcname: demonstrate end of line funcname matching flaw
  t4018-diff-funcname: rework negated last expression test
  Typo "does not exists" when git remote update remote.
  remote.c: correct the check for a leading '/' in a remote name
  Add testcase to ensure merging an early part of a branch is done properly

Conflicts:
	t/t7600-merge.sh
2008-10-17 01:52:32 -07:00
Mikael Magnusson 6c2a6022db Typo "does not exists" when git remote update remote. 2008-10-16 08:20:15 -07:00
Miklos Vajna 84ed4c5d11 Add Linux PPC support to the pre-auto-gc example hook
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-10-14 16:50:09 -07:00
Shawn O. Pearce d5c527448d Merge branch 'mw/sendemail'
* mw/sendemail:
  bash completion: Add --[no-]validate to "git send-email"
  send-email: signedoffcc -> signedoffbycc, but handle both
  Docs: send-email: Create logical groupings for man text
  Docs: send-email: Create logical groupings for --help text
  Docs: send-email: Remove unnecessary config variable description
  Docs: send-email: --chain_reply_to -> --[no-]chain-reply-to
  send-email: change --no-validate to boolean --[no-]validate
  Docs: send-email: Man page option ordering
  Docs: send-email usage text much sexier
  Docs: send-email's usage text and man page mention same options
2008-10-09 10:19:51 -07:00
Shawn O. Pearce 276328ffb8 Merge branch 'maint'
* maint:
  Update release notes for 1.6.0.3
  Teach rebase -i to honor pre-rebase hook
  docs: describe pre-rebase hook
  do not segfault if make_cache_entry failed
  make prefix_path() never return NULL
  fix bogus "diff --git" header from "diff --no-index"
  Fix fetch/clone --quiet when stdout is connected
  builtin-blame: Fix blame -C -C with submodules.
  bash: remove fetch, push, pull dashed form leftovers

Conflicts:
	diff.c
2008-10-06 08:56:07 -07:00
SZEDER Gábor 5a625b07bb bash: remove fetch, push, pull dashed form leftovers
We don't provide complation for git-commands in dashed form anymore,
so there is no need to keep those cases.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Tested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-05 23:48:43 -07:00
Teemu Likonen fd3a8dcbbd bash completion: Add --[no-]validate to "git send-email"
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-10-02 19:14:47 -07:00
Jonathan del Strother c33912ae24 Add OS X support to the pre-auto-gc example hook
Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 12:27:20 -07:00
SZEDER Gábor 1d4c498670 remove vim syntax highlighting in favor of upstream
As of version 7.2, vim ships with its own syntax
highlighting for git commit messages, which is:

  1. more comprehensive in splitting up the various
     components of the file

  2. in accordance with the usual vim behavior for syntax
     highlighting (e.g., respecting b:current_syntax)

  3. presumably better maintained (I have not been using
     what's in git's contrib/ directory for some time in
     favor of the upstream version)

Furthermore, vim upsream also provides syntax highlighting
for other git filetypes (gitconfig, rebase, send-email).

This patch gets rid of our local version and just points
interested parties to the upstream version.

The code for auto-detecting filetypes is taken from vim's
runtime/filetype.vim.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-30 11:48:41 -07:00
Nanako Shiraishi c11c7a5db3 Add contrib/rerere-train script
This script takes a range of commits (e.g. maint..next) as its arguments,
recreates merge commits in the range to prime rr-cache database.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-09-29 09:15:41 -07:00
Junio C Hamano c76dc9592d Merge branch 'maint'
* maint:
  Use dashless git commands in setgitperms.perl
  git-remote: do not use user input in a printf format string
2008-09-22 09:41:43 -07:00
Todd Zullinger 18309f4c3e Use dashless git commands in setgitperms.perl
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-22 09:36:12 -07:00
Junio C Hamano 34a5d35bbd Merge branch 'maint'
* maint:
  Start draft release notes for 1.6.0.3
  git-repack uses --no-repack-object, not --no-repack-delta.
  Typo "bogos" in format-patch error message.
  builtin-clone: fix typo
  Bust the ghost of long-defunct diffcore-pathspec.
  completion: git commit should list --interactive

Conflicts:
	RelNotes
2008-09-19 23:15:44 -07:00
SZEDER Gábor 05e8b3d6f4 bash: use for-each-ref format 'refname:short'
Using this format simplifies the code for completing refs and (in some
cases) improves performance significantly.

For repositories like the current git.git (with more than 200 refs)
there is no real performance difference, but for a repository with 2000
refs the total time needed to complete the refs is reduced by ~25% (from
around 400ms to around 305ms).

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>
2008-09-19 19:47:48 -07:00
Eric Raible aa5735bed4 completion: git commit should list --interactive
Signed-off-by: Eric Raible <raible@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-19 19:47:36 -07:00
Junio C Hamano 80d12c23de Merge branch 'jc/maint-log-grep'
* jc/maint-log-grep:
  log --author/--committer: really match only with name part
  diff --cumulative is a sub-option of --dirstat
  bash completion: Hide more plumbing commands
2008-09-04 22:30:44 -07:00
Petr Baudis ff2549dc9a bash completion: Hide more plumbing commands
git <tab><tab> still shows way too many commands, some of them
are clearly plumbing. This patch hides the plumbing commands
liberally (that is, in special cases, users still might want to
call one of the hidden commands, a *normal* workflow should never
involve these, though - and if it does, we have a UI problem anyway).

Signed-off-by: Petr Baudis <pasky@suse.cz>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-03 20:41:47 -07:00
Tor Arvid Lund e990501312 git-p4: Fix checkout bug when using --import-local.
When this option is passed to git p4 clone, the checkout at the end would
previously fail. This patch fixes it by optionally creating the master branch
from refs/heads/p4/master, which is the correct one for this option.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Acked-By: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-29 00:15:47 -07:00
Matthias Kestenholz 1b0f7978dd bash-completion: Add all submodule subcommands to the completion list
Signed-off-by: Matthias Kestenholz <mk@spinlock.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-28 20:39:43 -07:00
Simon Hausmann cdc7e388da Make it possible to abort the submission of a change to Perforce
Currently it is not possible to skip the submission of a change to Perforce
when running git-p4 submit. This patch compares the modification time before
and after the submit editor invokation and offers a prompt for skipping if
the submit template file was not saved.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-27 12:19:47 -07:00
Simon Hausmann f5f7e4a18c Clean up the git-p4 documentation
This patch massages the documentation a bit for improved readability and cleans
it up from outdated options/commands.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-24 12:00:14 -07:00
Tor Arvid Lund 893d340f2c git-p4: Fix one-liner in p4_write_pipe function.
The function built a p4 command string via the p4_build_cmd function, but
ignored the result.

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22 22:40:13 -07:00
Eric Raible f135aacb5a Completion: add missing '=' for 'diff --diff-filter'
Signed-off-by: Eric Raible <raible@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-22 16:15:21 -07:00
Junio C Hamano 25b3d4d6f3 completion: find out supported merge strategies correctly
"git-merge" is a binary executable these days, and looking for assignment
to $all_strategies variable with grep/sed does not work well.

When asked for an unknown strategy, pre-1.6.0 and post-1.6.0 "git merge"
commands respectively say:

    $ $HOME/git-snap-v1.5.6.5/bin/git merge -s help
    available strategies are: recur recursive octopus resolve stupid ours subtree
    $ $HOME/git-snap-v1.6.0/bin/git merge -s help
    Could not find merge strategy 'help'.
    Available strategies are: recursive octopus resolve ours subtree.

both on their standard error stream.  We can use this to learn what
strategies are supported.

The sed script is written in such a way that it catches both old and new
message styles ("Available" vs "available", and the full stop at the end).
It also allows future versions of "git merge" to line-wrap the list of
strategies, and add extra comments, like this:

    $ $HOME/git-snap-v1.6.1/bin/git merge -s help
    Could not find merge strategy 'help'.
    Available strategies are: blame recursive octopus resolve ours
    subtree.
    Also you have custom strategies: theirs

    Make sure you spell strategy names correctly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-20 15:48:52 -07:00
Junio C Hamano a1975c4fea Merge branch 'ak/p4'
* ak/p4:
  Utilise our new p4_read_pipe and p4_write_pipe wrappers
  Add p4 read_pipe and write_pipe wrappers
  Put in the two other configuration elements found in the source
  Put some documentation in about the parameters that have been added
  Move git-p4.syncFromOrigin into a configuration parameters section
  Consistently use 'git-p4' for the configuration entries
  If the user has configured various parameters, use them.
  Switch to using 'p4_build_cmd'
  If we are in verbose mode, output what we are about to run (or return)
  Add a single command that will be used to construct the 'p4' command
  Utilise the new 'p4_system' function.
  Have a command that specifically invokes 'p4' (via system)
  Utilise the new 'p4_read_pipe_lines' command
  Create a specific version of the read_pipe_lines command for p4 invocations

Conflicts:
	contrib/fast-import/git-p4
2008-08-17 10:53:57 -07:00
Robert Blum 053fd0c1c3 git-p4: chdir now properly sets PWD environment variable in msysGit
P4 on Windows expects the PWD environment variable to be set to the
current working dir, but os.chdir in python doesn't do so.

Signed-off-by: Robert Blum <rob.blum@gmail.com>
Acked-by: Simon Hausmann <simon@lst.de>
Acked-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16 23:37:04 -07:00
Marcus Griep 2946cccfdf bash-completion: Add non-command git help files to bash-completion
Git allows access to the gitattributes man page via `git help attributes`,
but this is not discoverable via the bash-completion mechanism.  This
patch adds all current non-command man pages to the completion candidate
list.

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-16 02:32:01 -07:00
Anand Kumria a7d3ef9d09 Utilise our new p4_read_pipe and p4_write_pipe wrappers
Signed-off-by: Anand Kumria <wildfire@progsoc.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-14 18:14:24 -07:00
Anand Kumria d9429194f6 Add p4 read_pipe and write_pipe wrappers
Two additional wrappers to cover 3 places where we utilise p4 in piped
form.  Found by Tor Arvid Lund.

Signed-off-by: Anand Kumria <wildfire@progsoc.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-14 18:14:23 -07:00