1
0
mirror of https://github.com/git/git.git synced 2024-09-30 17:11:23 +02:00
Commit Graph

804 Commits

Author SHA1 Message Date
Miklos Vajna
6376cffaeb hg-to-git: avoid raising a string exception
This fixes the following warning:
hg-to-git.py:92: DeprecationWarning: raising a string exception is deprecated

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 23:35:11 -07:00
SZEDER Gábor
7bedebcaad stash: introduce 'stash save --keep-index' option
'git stash save' saves local modifications to a new stash, and runs 'git
reset --hard' to revert them to a clean index and work tree.  When the
'--keep-index' option is specified, after that 'git reset --hard' the
previous contents of the index is restored and the work tree is updated
to match the index.  This option is useful if the user wants to commit
only parts of his local modifications, but wants to test those parts
before committing.

Also add support for the completion of the new option, and add an
example use case to the documentation.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-05 11:22:13 -07:00
Johannes Schindelin
be612c2318 Add another fast-import example, this time for .zip files
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-01 00:48:17 -07:00
Olivier Marin
8813df9066 Documentation: remove {show,whatchanged}.difftree config options
This removes, from the documentation and the bash completion script, the
two config options that were introduced by the git-whatchanged.sh script
and lost in the C rewrite. Today, we can use aliases as an alternative.

Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-28 20:55:26 -07:00
Jing Xue
4c2d5d722c Add 'git-p4.allowSubmit' to git-p4
I'm working with a perforce repo using git-p4. There are some config
files which I need to change locally according to my environment. I'm
using a 'local' git branch to park these changes. And I want to avoid
accidentally checking them into p4 just by doing "git p4 submit"
mindlessly without realizing which branch I'm actually on.

This patch adds a new git config, 'git-p4.allowSubmit', which is a
whitelist of branch names. "git p4 submit" will only allow submissions
from local branches on the list. Useful for preventing inadvertently
submitting from a strictly local branch.

For backward compatibility, if this config is not set at all,
submissions from all branches are allowed.

Signed-off-by: Jing Xue <jingxue@digizenstudio.com>
Acked-By: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-26 12:10:42 -07:00
Teemu Likonen
66aafad5e4 bash: Add more option completions for 'git log'
Options added: --walk-reflogs --stat --numstat --shortstat
--decorate --diff-filter= --color-words

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-20 10:32:47 -07:00
Lukas Sandström
0c3d26d24a Add a helper script to send patches with Mozilla Thunderbird
The script appp.sh can be used with the External Editor extension for
Mozilla Thunderbird in order to be able to send inline patches in an
easy way.

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19 22:40:42 -07:00
Dan McGee
20827d99c5 completion: add --graph to log command completion
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-19 16:02:31 -07:00
SZEDER Gábor
1d284cbae3 completion: add more 'git add' options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-14 12:47:44 -07:00
Karl Hasselström
3db4723ead Revert "git.el: Set process-environment instead of invoking env"
This reverts commit dbe48256b41c1e94d81f2458d7e84b1fdcb47026, which
caused mis-encoding of non-ASCII author/committer names when the
git-status mode is used to create commits.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-02 19:07:12 -07:00
Johannes Schindelin
37a12dda24 hg-to-git: add --verbose option
This patch adds an option to make hg-to-git quiet by default.  Note:
it only suppresses those messages that would be printed when everything
was up-to-date.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-26 10:43:39 -07:00
Shawn O. Pearce
fa620f1ac8 Ignore no-op changes in paranoid update hook
If the hook gets invoked with identical old and new ids there
is no change taking place.  We probably should not have been
called, but instead of failing silently allow the no-op.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 20:29:30 -07:00
Shawn O. Pearce
50b7b2ee99 Don't load missing ACL files in paranoid update hook
If a user or group ACL file does not exist in the current tip
revision of the acl repository we will get an error from cat-file
when we ask for that blob as it cannot be resolved.  A quick look
at the history by rev-list can tell us if there is a path there
or not.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 20:29:30 -07:00
Shawn O. Pearce
97561fff32 Don't diff empty tree on branch creation in paranoid update hook
Listing all files in a branch during branch creation is silly;
the user's file-level ACLs probably don't mean anything at this
point.  We now treat the base case of 0{40} as an empty diff,
as this happens only when the user is creating the branch and
there are file level ACLs that diff against the old value of
the branch.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-25 20:29:30 -07:00
Junio C Hamano
b84c343c88 Merge branch 'db/clone-in-c'
* db/clone-in-c:
  Add test for cloning with "--reference" repo being a subset of source repo
  Add a test for another combination of --reference
  Test that --reference actually suppresses fetching referenced objects
  clone: fall back to copying if hardlinking fails
  builtin-clone.c: Need to closedir() in copy_or_link_directory()
  builtin-clone: fix initial checkout
  Build in clone
  Provide API access to init_db()
  Add a function to set a non-default work tree
  Allow for having for_each_ref() list extra refs
  Have a constant extern refspec for "--tags"
  Add a library function to add an alternate to the alternates file
  Add a lockfile function to append to a file
  Mark the list of refs to fetch as const

Conflicts:

	cache.h
	t/t5700-clone-reference.sh
2008-05-25 13:41:37 -07:00
Junio C Hamano
ca1c9913f8 Merge branch 'sg/merge-options' (early part)
* 'sg/merge-options' (early part):
  merge, pull: add '--(no-)log' command line option
  fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
  add 'merge.stat' config variable
  merge, pull: introduce '--(no-)stat' option
  doc: moved merge.* config variables into separate merge-config.txt
2008-05-08 20:06:36 -07:00
Daniel Barkalow
8434c2f1af Build in clone
Thanks to Johannes Schindelin for various comments and improvements,
including supporting cloning full bundles.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-04 17:41:45 -07:00
Richard Quirk
07ba53f724 bash: Add completion for gitk --merge
Option is only completed when .git/MERGE_HEAD is present.

Signed-off-by: Richard Quirk <richard.quirk@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-27 21:38:22 -07:00
Junio C Hamano
bdb87afb4b Merge branch 'maint'
* maint:
  post-receive-email: fix accidental removal of a trailing space in signature line
  Escape project names before creating pathinfo URLs
  Escape project name in regexp
  bash: Add completion for git diff --base --ours --theirs
  diff-options.txt: document the new "--dirstat" option
2008-04-22 00:10:20 -07:00
Andy Parkins
71bd81ade2 post-receive-email: fix accidental removal of a trailing space in signature line
post-receive-email adds a signature to the end of emails in
generate_email_footer().  The signature was separated from the main email
body using the standard string "-- ". (see RFC 3676)

a6080a0 (War on whitespace, 2007-06-07) removed the trailing whitespace
from "-- ", leaving it as "--", which is not a correct signature
separator.

This patch restores the missing space, but does it in a way that will
not set off the trailing whitespace alarms.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:36:56 -07:00
Dan McGee
799596a5d0 completion: remove use of dashed git commands
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:33:23 -07:00
Dan McGee
3903c6189d completion: allow 'git remote' subcommand completion
After typing 'git remote ', the subcommand options were not shown. Fix it
by adding the missing __gitcomp call.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 23:32:09 -07:00
Clifford Caoile
dbe48256b4 git.el: Set process-environment instead of invoking env
According to the similar patch from David Kågedal [1], "this will make
it a little less posix-dependent and more efficient." However, there
are two other areas that need to replaced, namely
git-run-command-region and git-run-hooks. This patch implements the
changes of [1] onto those Emacs Lisp functions.

If unpatched, using the git port "msysgit" on Windows will require
defadvice changes as shown at [2] (also explained at 4msysgit.git
[3]).

I have tested git-run-command-region on msysgit, because this is
always called by git-commit (via git-commit-tree <- git-do-commit <-
git-commit-file). However, I could not test git-run-hooks because it
currently does not work on the Emacs Windows port. The latter reports
the hooks files as a+rw and a-x, despite msysgit and cygwin chmod
setting on the respective files.

References:
[1] f27e55864317611385be4d33b3c53ca787379df9
[2] http://groups.google.com/group/msysgit/browse_thread/thread/b852fef689817707
[3] http://repo.or.cz/w/git/mingw/4msysgit.git?a=commit;h=3c30e5e87358eba7b6d7dcd6301ae8438f0c30ea

Signed-off-by: Clifford Caoile <piyo@users.sourceforge.net>
Acked-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-21 22:56:16 -07:00
Teemu Likonen
f457413908 bash: Add completion for git diff --base --ours --theirs
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>
2008-04-21 22:52:15 -07:00
SZEDER Gábor
efb779f887 merge, pull: add '--(no-)log' command line option
These are the command line option equivalents of the 'merge.log' config
variable.

The patch also updates documentation and bash completion accordingly, and
adds a test.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 19:28:18 -07:00
SZEDER Gábor
d8abe148be merge, pull: introduce '--(no-)stat' option
This option has the same effect as '--(no-)summary' (i.e. whether to
show a diffsat at the end of the merge or not), and it is consistent
with the '--stat' option of other git commands.

Documentation, tests, and bash completion are updaed accordingly, and the
old --summary option is marked as being deprected.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-12 19:28:18 -07:00
Miklos Vajna
f949844263 contrib/hooks: add an example pre-auto-gc hook
It disables git-gc --auto when you are running Linux and you are
not on AC.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-09 01:31:13 -07:00
Pascal Obry
aba201c6e8 Add prefix oriented completions for diff and format-patch commands.
Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-06 20:03:09 -07:00
Pascal Obry
d9e3b7025f Add interactive option in rebase command completion list.
Signed-off-by: Pascal Obry <pascal@obry.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-04-06 20:01:17 -07:00
Josh Elsasser
6aeeffd144 Allow git-cvsserver database table name prefix to be specified.
Adds a gitcvs.dbtablenameprefix config variable, the contents of which
are prepended to any database tables names used by git-cvsserver. The
same substutions as gitcvs.dbname and gitcvs.dbuser are supported, and
any non-alphabetic characters are replaced with underscores.

A typo found in contrib/completion/git-completion.bash is also fixed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-30 22:21:35 -07:00
Marius Storm-Olsen
f3e5ae4f06 git-p4: Handle Windows EOLs properly after removal of p4 submit template handling.
git-p4s handling of Windows style EOL was broken after the removal
of the p4 submit template handling in commit f2a6059. Fix that, and
make getP4OpenedType() more robust.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-28 16:27:39 +01:00
Junio C Hamano
dc96bdb946 Merge branch 'git-p4' of git://repo.or.cz/git/git-p4
* 'git-p4' of git://repo.or.cz/git/git-p4:
  git-p4: Use P4EDITOR environment variable when set
  git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
  git-p4: Optimize the fetching of data from perforce.
2008-03-23 00:02:06 -07:00
Junio C Hamano
c817faabd7 Resurrect git-rerere to contrib/examples
It is handy to have a copy readily available for checking regressions.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-16 01:11:07 -07:00
Junio C Hamano
2a2ad0c000 Merge branch 'maint'
* maint:
  Make man page building quiet when DOCBOOK_XSL_172 is defined
  git-new-workdir: Share SVN meta data between work dirs and the repository
  rev-parse: fix meaning of rev~ vs rev~0.
  git-svn: don't blindly append '*' to branch/tags config
2008-03-15 00:05:40 -07:00
Bernt Hansen
ac378633f3 git-new-workdir: Share SVN meta data between work dirs and the repository
Multiple work dirs with git svn caused each work dir to have its own
stale copy of the SVN meta data in .git/svn

git svn rebase updates commits with git-svn-id: in the repository and
stores the SVN meta data information only in that work dir.  Attempting to
git svn rebase in other work dirs for the same branch would fail because
the last revision fetched according to the git-svn-id is greater than the
revision in the SVN meta data for that work directory.

Signed-off-by: Bernt Hansen <bernt@norang.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-15 00:05:18 -07:00
Shawn Bohrer
82cea9ffb1 git-p4: Use P4EDITOR environment variable when set
Perforce allows you to set the P4EDITOR environment variable to your
preferred editor for use in perforce.  Since we are displaying a
perforce changelog to the user we should use it when it is defined.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Shawn Bohrer
67abd41716 git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'
A custom diffing utility can be specified for the 'p4 diff' command by
setting the P4DIFF environment variable.  However when using a custom
diffing utility such as 'vimdiff' passing options like -du can cause
unexpected behavior.

Since the goal is to generate a unified diff of the changes and attach
them to the bottom of the p4 submit log we should unset P4DIFF if it
has been set in order to generate the diff properly.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Marius Storm-Olsen
8ff45f2af5 git-p4: Optimize the fetching of data from perforce.
Use shallow copies in loop, and join content at the end. Then do the substitution, if needed.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-03-13 08:57:29 +01:00
Junio C Hamano
ae90e16a3a Merge branch 'js/remote'
* js/remote:
  "remote update": print remote name being fetched from
  builtin remote rm: remove symbolic refs, too
  remote: fix "update [group...]"
  remote show: Clean up connection correctly if object fetch wasn't done
  builtin-remote: prune remotes correctly that were added with --mirror
  Make git-remote a builtin
  Test "git remote show" and "git remote prune"
  parseopt: add flag to stop on first non option
  path-list: add functions to work with unsorted lists

Conflicts:

	parse-options.c
2008-03-11 22:33:51 -07:00
SZEDER Gábor
5447aac755 bash: fix long option with argument double completion
Pressing TAB right after 'git command --long-option=' results in
'git command --long-option=--long-option=' when the long option requires
an argument, but we don't provide completion for its arguments (e.g.
commit --author=, apply --exclude=).  This patch detects these long
options and provides empty completion array for them.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 20:02:15 -04:00
Teemu Likonen
ce5a2c956f bash: Add more long options to be completed with "git --<TAB>"
Add the following long options to be completed with command "git":

	--paginate
	--work-tree=
	--help

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 20:00:40 -04:00
SZEDER Gábor
51fe120903 bash: use __gitdir when completing 'git rebase' options
When doing completion of rebase options in a subdirectory of the work
tree during an ongoing rebase, wrong options were offered because of the
hardcoded .git/.dotest-merge path.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:55:07 -04:00
Shawn O. Pearce
6753f2aa55 bash: Remove completion of core.legacyheaders option
This option is no longer recognized by git.  Completing it is
not worthwhile.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:49:28 -04:00
SZEDER Gábor
47f6ee2838 bash: add 'git svn' subcommands and options
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:40 -04:00
SZEDER Gábor
88b302f5e2 bash: add new 'git stash' subcommands
Namely 'save', 'drop', 'pop' and 'create'

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
SZEDER Gábor
3ff1320d4b bash: refactor searching for subcommands on the command line
This patch adds the __git_find_subcommand function, which takes one
argument: a string containing all subcommands separated by spaces.  The
function searches through the command line whether a subcommand is
already present.  The first found subcommand will be printed to standard
output.

This enables us to remove code duplications from completion functions
for commands having subcommands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
SZEDER Gábor
1d17b22ebf bash: remove unnecessary conditions when checking for subcommands
Checking emptyness of $command is sufficient.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:45:20 -04:00
Kevin Ballard
a5c4f85b16 bash: Properly quote the GIT_DIR at all times to fix subdirectory paths with spaces
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10 19:44:40 -04:00
Junio C Hamano
dabc42c713 Merge branch 'jc/am'
* jc/am:
  am: --rebasing
  am: remove support for -d .dotest
  am: read from the right mailbox when started from a subdirectory
2008-03-08 20:10:05 -08:00
Junio C Hamano
5628a7a309 Merge branch 'dc/format-pretty'
* dc/format-pretty:
  log/show/whatchanged: introduce format.pretty configuration
  specify explicit "--pretty=medium" with `git log/show/whatchanged`
  whatchanged documentation: share description of --pretty with others
2008-03-07 22:33:26 -08:00
SZEDER Gábor
b9217642ef bash: git-branch -d and -m lists only local branches
But still all branches are listed, if -r is present

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-03-05 12:10:29 -08:00
SZEDER Gábor
3b376b0cb8 bash: add git-branch 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>
2008-03-05 12:10:29 -08:00
Denis Cheng
9225d7be0a specify explicit "--pretty=medium" with git log/show/whatchanged
The following patch will introduce a new configuration variable,
"format.pretty", from then on the pretty format without specifying
"--pretty" might not be the default "--pretty=medium", it depends on
the user's config. So all kinds of Shell/Perl/Emacs scripts that needs
the default medium pretty format must specify it explicitly.

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 12:06:09 -08:00
Junio C Hamano
3041c32430 am: --rebasing
The new option --rebasing is used internally for rebase to tell am that
it is being used for its purpose.  This would leave .dotest/rebasing to
help "completion" scripts tell if the ongoing operation is am or rebase.

Also the option at the same time stands for --binary, -3 and -k which
are always given when rebase drives am as its backend.

Using the information "am" leaves, git-completion.bash tells ongoing
rebase and am apart.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05 10:52:56 -08:00
Simon Hausmann
30b5940bcd git-p4: Fix import of changesets with file deletions
Commit 3a70cdfa42199e16d2d047c286431c4274d65b1a made readP4Files abort quickly
when the changeset only contains files that are marked for deletion with an empty return
value, which caused the commit to not do anything.

This commit changes readP4Files to distinguish between files that need to be passed to p4
print and files that have no content ("deleted") and merge them in the returned
list.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-03 21:53:51 -08:00
Junio C Hamano
c0b48ad777 Merge branch 'np/verify-pack'
* np/verify-pack:
  add storage size output to 'git verify-pack -v'
  fix unimplemented packed_object_info_detail() features
  make verify_one_pack() a bit less wrong wrt packed_git structure
  factorize revindex code out of builtin-pack-objects.c

Conflicts:

	Makefile
2008-03-02 16:07:30 -08:00
Johannes Schindelin
211c89682e Make git-remote a builtin
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-01 01:51:44 -08:00
Nicolas Pitre
5f4347bba3 add storage size output to 'git verify-pack -v'
This can possibly break external scripts that depend on the previous
output, but those script can't possibly be critical to Git usage, and
fixing them should be trivial.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-01 01:44:46 -08:00
Junio C Hamano
df4a824341 Merge branch 'maint'
* maint:
  Documentation cherry-pick: Fix cut-and-paste error
  git.el: find the git-status buffer whatever its name is
  git-gui: Paper bag fix info dialog when no files are staged at commit
2008-02-29 21:22:31 -08:00
Rémi Vanicat
a1eebfb3a9 git.el: find the git-status buffer whatever its name is
git-status used the buffer name to find git-status buffers, and that
can fail if the buffer has another name, for example when multiple
working directories is tracked.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Tested-by: Xavier Maillard <xma@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-29 21:22:18 -08:00
Johannes Schindelin
be5f5bf027 completion: support format-patch's --cover-letter option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-27 18:13:40 -08:00
Junio C Hamano
a0a80f1e8a Merge branch 'git-p4' of git://repo.or.cz/git/git-p4
* 'git-p4' of git://repo.or.cz/git/git-p4:
  git-p4: Support usage of perforce client spec
  git-p4: git-p4 submit cleanups.
  git-p4: Removed git-p4 submit --direct.
  git-p4: Clean up git-p4 submit's log message handling.
  git-p4: Remove --log-substitutions feature.
  git-p4: support exclude paths
2008-02-27 13:56:42 -08:00
Alexandre Julliard
21a2d69b2a git.el: Do not display empty directories.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Tested-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-27 13:17:58 -08:00
Junio C Hamano
5a4d707a6d Merge branch 'db/checkout'
* db/checkout: (21 commits)
  checkout: error out when index is unmerged even with -m
  checkout: show progress when checkout takes long time while switching branches
  Add merge-subtree back
  checkout: updates to tracking report
  builtin-checkout.c: Remove unused prefix arguments in switch_branches path
  checkout: work from a subdirectory
  checkout: tone down the "forked status" diagnostic messages
  Clean up reporting differences on branch switch
  builtin-checkout.c: fix possible usage segfault
  checkout: notice when the switched branch is behind or forked
  Build in checkout
  Move code to clean up after a branch change to branch.c
  Library function to check for unmerged index entries
  Use diff -u instead of diff in t7201
  Move create_branch into a library file
  Build-in merge-recursive
  Add "skip_unmerged" option to unpack_trees.
  Discard "deleted" cache entries after using them to update the working tree
  Send unpack-trees debugging output to stderr
  Add flag to make unpack_trees() not print errors.
  ...

Conflicts:

	Makefile
2008-02-27 12:53:26 -08:00
Tor Arvid Lund
3a70cdfa42 git-p4: Support usage of perforce client spec
When syncing, git-p4 will only download files that are included in the active
perforce client spec. This does not change the default behaviour - it requires
that the user either supplies the command line argument --use-client-spec, or
sets the git config option p4.useclientspec to "true".

Signed-off-by: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 16:27:13 +01:00
Simon Hausmann
4c750c0d8b git-p4: git-p4 submit cleanups.
Removed storing the list of commits in a configuration file. We only need the list
of commits at run-time.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 16:27:10 +01:00
Simon Hausmann
0e36f2d726 git-p4: Removed git-p4 submit --direct.
This feature was originally meant to allow for quicker direct submits into perforce, but
it turns out that it is not actually quicker than doing a git commit and then running
git-p4 submit.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 16:27:07 +01:00
Simon Hausmann
edae1e2f40 git-p4: Clean up git-p4 submit's log message handling.
Instead of trying to substitute fields in the p4 submit template we now simply
replace the description of the submit with the log message of the git commit.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 16:27:03 +01:00
Simon Hausmann
4b61b5c963 git-p4: Remove --log-substitutions feature.
This turns out to be rarely useful and is already covered by git's commit.template configuration variable.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 16:26:57 +01:00
Tommy Thorn
354081d5a0 git-p4: support exclude paths
Teach git-p4 about the -/ option which adds depot paths to the exclude
list, used when cloning. The option is chosen such that the natural
Perforce syntax works, eg:

  git p4 clone //branch/path/... -//branch/path/{large,old}/...

Trailing ... on exclude paths are optional.

This is a generalization of a change by Dmitry Kakurin (thanks).

Signed-off-by: Tommy Thorn <tommy-git@thorn.ws>
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-27 15:17:05 +01:00
Shawn O. Pearce
27c578885a Use git-describe --exact-match in bash prompt on detached HEAD
Most of the time when I am on a detached HEAD and I am not doing
a rebase or bisect operation the working directory is sitting on a
tagged release of the repository.  Showing the tag name instead of
the commit SHA-1 is much more descriptive and a much better reminder
of the state of this working directory.

Now that git-describe --exact-match is available as a cheap means
of obtaining the exact annotated tag or nothing at all, we can
favor the annotated tag name over the abbreviated commit SHA-1.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-24 10:01:24 -08:00
David Kågedal
f27e558643 git.el: Set process-environment instead of invoking env
This will make it a little less posix-dependent, and more efficient.

Included is also a minor doc improvement.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-20 11:25:14 -08:00
Daniel Barkalow
782c2d65c2 Build in checkout
The only differences in behavior should be:

 - git checkout -m with non-trivial merging won't print out
   merge-recursive messages (see the change in t7201-co.sh)

 - git checkout -- paths... will give a sensible error message if
   HEAD is invalid as a commit.

 - some intermediate states which were written to disk in the shell
   version (in particular, index states) are only kept in memory in
   this version, and therefore these can no longer be revealed by
   later write operations becoming impossible.

 - when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
   rr-cache/MERGE_RR, like reset always has.

I'm not 100% sure I got the merge recursive setup exactly right; the
base for a non-trivial merge in the shell code doesn't seem
theoretically justified to me, but I tried to match it anyway, and the
tests all pass this way.

Other than these items, the results should be identical to the shell
version, so far as I can tell.

[jc: squashed lock-file fix from Dscho in]

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-16 15:05:02 -08:00
Junio C Hamano
d5558581d2 Merge branch 'maint'
* maint:
  commit: discard index after setting up partial commit
  filter-branch: handle filenames that need quoting
  diff: Fix miscounting of --check output
  hg-to-git: fix parent analysis
  mailinfo: feed only one line to handle_filter() for QP input
  diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
  Add "const" qualifier to "char *excludes_file".
  Add "const" qualifier to "char *editor_program".
  Add "const" qualifier to "char *pager_program".
  config: add 'git_config_string' to refactor string config variables.
  diff.c: remove useless check for value != NULL
  fast-import: check return value from unpack_entry()
  Validate nicknames of remote branches to prohibit confusing ones
  diff.c: replace a 'strdup' with 'xstrdup'.
  diff.c: fixup garding of config parser from value=NULL
2008-02-16 00:20:37 -08:00
Stelian Pop
13bf1a9976 hg-to-git: fix parent analysis
Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:

    Traceback (most recent call last):
      File "hg-to-git.py", line 123, in <module>
          hgchildren[mparent] += ( str(cset), )
      KeyError: ''

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-15 23:01:49 -08:00
Junichi Uekawa
24a2293ad3 git-blame.el: show the when, who and what in the minibuffer.
Change the default operation to show 'when (day the commit was made),
who (who made the commit), what (what the commit log was)' in the
minibuffer instead of SHA1 and title of the commit log.

Since the user may prefer other displaying options, it is made as a
user-configurable option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-11 13:23:15 -08:00
Alexandre Julliard
0520e2154f git.el: Better handling of subprocess errors.
Where possible, capture the output of the git command and display it
if the command fails.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-08 00:13:18 -08:00
Alexandre Julliard
928323af6b git.el: Check for existing buffers on revert.
Refuse to revert a file if it is modified in an existing buffer but
not saved. On success, revert the buffers that contains the files that
have been reverted.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-08 00:13:18 -08:00
Alexandre Julliard
76127b3a0d git.el: Added a command to amend a commit.
It reverts the commit and sets up the status and edit log buffer to
allow making changes and recommitting it. Bound to C-c C-a.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-08 00:13:18 -08:00
Alexandre Julliard
3f3d564aa7 git.el: Support for showing unknown/ignored directories.
Instead of recursing into directories that only contain unknown files,
display only the directory itself. Its contents can be expanded with
git-find-file (bound to C-m).

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-08 00:13:18 -08:00
Toby Allsopp
053d9e432b git-p4: Fix indentation from tab to spaces
Signed-off-by: Toby Allsopp <toby.allsopp@navman.co.nz>
2008-02-07 00:39:08 -08:00
Robin Rosenberg
e75201963f Improve bash prompt to detect various states like an unfinished merge
This patch makes the git prompt (when enabled) show if a merge or a
rebase is unfinished. It also detects if a bisect is being done as
well as detached checkouts.

An uncompleted git-am cannot be distinguised from a rebase (the
non-interactive version). Instead of having an even longer prompt
we simply ignore that and hope the power users that use git-am knows
the difference.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
2008-02-06 22:47:36 -08:00
Tommy Thorn
147402a2e9 git-p4: Fix an obvious typo
The regexp "$," can't match anything. Clearly not intended.

This was introduced in ce6f33c8 which is quite a while ago.

Signed-off-by: Tommy Thorn <tommy-git@thorn.ws>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-03 13:00:15 -08:00
Simon Hausmann
36ee4ee40e git-p4: Ensure the working directory and the index are clean before "git-p4 rebase"
Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-03 19:19:16 +01:00
Simon Hausmann
e96e400f67 git-p4: Fix submit user-interface.
Don't ask any questions when submitting, behave similar to git-svn dcommit.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-03 19:19:05 +01:00
Jason McMullan
f3e9512be1 Remove $Id: ..$ $Header: ..$ etc from +ko and +k files during import
This patch removes the '$Keyword: ...$' '...' data, so that files
don't have spurious megre conflicts between branches.

Handles both +ko and +k styles, and leaves the '$Foo$' in
the original file.

Signed-off-by: Simon Hausmann <simon@lst.de>
2008-02-03 19:18:33 +01:00
Dan McGee
a3b811a491 Update git-completion for new 'remote rm' option
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-19 23:06:02 -08:00
Junio C Hamano
5c66d0d458 Officially deprecate repo-config.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-17 22:52:40 -08:00
Mark Drago
1bc7c13af9 hg-to-git: improve popen calls
This patch improves all of the popen calls in hg-to-git.py by specifying the
template 'hg log' should use instead of calling 'hg log' and grepping for the
desired data.

Signed-off-by: Mark Drago <markdrago@gmail.com>
Acked-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-15 17:24:29 -08:00
Dan McGee
22fa97d4e0 Remove usage of git- (dash) commands from email hook
Switch all git command calls to use the git (space) command format, and
remove the use of git-repo-config in place of git config.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-13 21:48:20 -08:00
Alexandre Julliard
ef40b3efe0 git.el: Make status refresh faster.
Don't set the needs-refresh flag when inserting a new file info, since
ewoc refreshes it upon insert already; this makes a full refresh twice
as fast.

Also make git-fileinfo-prettyprint a little faster by not retrieving
permission values twice.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-08 16:17:44 -08:00
Alexandre Julliard
58152a02d9 git.el: Refresh files from their real state upon commit.
Instead of just setting the state to up-to-date, retrieve the full
state again, so that the file type can be displayed properly.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-08 16:17:44 -08:00
Alexandre Julliard
87e3d81294 git.el: Make sure we never insert the same file twice.
Skip non-zero stage files during git-ls-files -c, they are handled
later. Also fix git-insert-info-list to merge duplicate file names.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-08 16:17:44 -08:00
Alexandre Julliard
40f162b04b git.el: Display file types and type changes.
Handle the T status from git-diff-index to display type changes
between file/symlink/subproject. Also always show the file type for
symlink and subprojects to indicate that they are not normal files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-06 18:41:44 -08:00
Alexandre Julliard
5e3cb7e503 git.el: Retrieve the permissions for up-to-date files.
This allows displaying correctly the executable flag for the initial
commit, and will make it possible to show the file type for up-to-date
symlinks and subprojects.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-06 18:41:44 -08:00
Alexandre Julliard
8b30aa5059 git.el: Support for getting diffs from inside the log-edit buffer.
Take advantage of the new log-edit feature that allows to show a diff
with C-c C-d while editing the log message.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-06 18:41:44 -08:00
Junio C Hamano
e25cfae667 contrib: resurrect scripted git-revert.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-26 17:38:00 -08:00
Jeff King
718a087a47 teach bash completion to treat commands with "--" as a helper
There is a convention that commands containing a double-dash
are implementation details and not to be used by mortals. We
should automatically remove them from the completion
suggestions as such.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16 11:55:48 -08:00
Alexandre Julliard
18ff365fcb git.el: Added a menu for git-status-mode.
Originally written by Rémi Vanicat, I just changed the layout a little.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-11 09:55:21 -08:00
Junio C Hamano
90e0653b18 hg-to-git: handle an empty dir in hg.
Mark Drago had a subversion repository which was then converted to hg
and now is moving in to git.  The first commit in the svn repo was
just the creation of the empty directory.  This made its way in to the
hg repository fine, but converting from hg to git would cause an
error.  The problem was that hg-to-git.py tries to commit the change,
git-commit fails, and then hg-to-git.py tries to checkout the new
revision and that fails (because it was not created).  This may have
only caused an error because it was the first commit in the
repository.  If an empty directory was added in the middle of the repo
somewhere things might have worked out fine.

This patch will use the new --allow-empty option to git-commit to
record such an "empty" commit, to reproduce the history recorded in hg
more faithfully.

Tested-by: Mark Drago <markdrago@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-06 07:26:29 -08:00