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

97 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Alexandre Julliard
d53a35020d git.el: Run git-gc --auto after commits.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28 14:08:28 -07:00
Alexandre Julliard
2f6e86a86f git.el: Refresh only the changed file marks when marking/unmarking all.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28 14:08:28 -07:00
Alexandre Julliard
6df023884b git.el: Fix typo in git-update-saved-file error handling.
Spotted by Matthieu Lemerre.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28 14:08:28 -07:00
Alexandre Julliard
3697c5f37a git.el: Fix typo in "Reverted file" message.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-28 14:08:28 -07:00
Alexandre Julliard
72dc52bfe6 git.el: Reset the permission flags when changing a file state.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 23:44:06 -07:00
Alexandre Julliard
0365d885ad git.el: Update a file status in the git buffer upon save.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 23:44:05 -07:00
Alexandre Julliard
9f5599b982 git.el: Do not print a status message on every git command.
Instead print a single message around sequences of commands that can
potentially take some time.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 23:44:05 -07:00
Alexandre Julliard
b9b7bab4b6 git.el: Preserve file marks when doing a full refresh.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-29 23:44:05 -07:00
Alexandre Julliard
568d2cde9b git.el: Allow the add and remove commands to be applied to ignored files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:37:54 -07:00
Alexandre Julliard
98acc3fabc git.el: Allow selecting whether to display uptodate/unknown/ignored files.
The default behavior for each state can be customized, and it can also
be toggled directly from the status buffer.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:37:54 -07:00
Alexandre Julliard
1b655040be git.el: Keep the status buffer sorted by filename.
This makes insertions and updates much more efficient.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 22:36:22 -07:00
David Kågedal
1ff55ff27b git.el: Added colors for dark background
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-29 00:08:32 -07:00
Alexandre Julliard
ef08c14993 git.el: Avoid a lisp error when there's no current branch (detached HEAD).
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-22 15:29:08 -07:00
Alexandre Julliard
8fdc39729b git.el: Always set the current directory in the git-diff buffer.
This allows jumping to the correct file with the diff-mode commands.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13 12:58:38 -07:00
Alexandre Julliard
09afcd6933 git.el: Add support for interactive diffs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13 12:58:38 -07:00
Alexandre Julliard
274e13e0e9 git.el: Take into account the core.excludesfile config option.
Also don't require .git/info/exclude to exist in order to list unknown
files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 23:05:43 -07:00
Alexandre Julliard
61988f1127 git.el: Avoid using ewoc-set-data for compatibility with Emacs 21.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-31 23:04:10 -07:00
Alexandre Julliard
ceefa44fe2 git.el: Pass an explicit argument to enable smerge-mode.
Without argument the mode is toggled, which would do the wrong thing
if the file was already open.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Alexandre Julliard
93c22eeb30 git.el: Support for incremental status updates.
When we know which files have been modified, we can now run diff-index
or ls-files with a file list to refresh only the specified files
instead of the whole project.

This also allows proper refreshing of files upon add/delete/resolve,
instead of making assumptions about the new file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 03:16:26 -07:00
David Kastrup
99c01de402 contrib/emacs/Makefile: Also install .el files.
Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 20:21:51 -07:00
Emil Medve
4cb08df553 Use $(RM) in Makefiles instead of 'rm -f'
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 23:31:01 -07:00
David Kastrup
248c648a0d Add missing functions to contrib/emacs/vc-git.el
This is necessary to make several editing functions work, like
C-u C-x v =

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12 14:38:15 -07:00
Johannes Schindelin
b4372ef136 Enable "git rerere" by the config variable rerere.enabled
Earlier, "git rerere" was enabled by creating the directory
.git/rr-cache.  That is definitely not in line with most other
features, which are enabled by a config variable.

So, check the config variable "rerere.enabled". If it is set
to "false" explicitely, do not activate rerere, even if
.git/rr-cache exists. This should help when you want to disable
rerere temporarily.

If "rerere.enabled" is not set at all, fall back to detection
of the directory .git/rr-cache.

[jc: with minimum tweaks]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-06 22:39:15 -07:00
Alexandre Julliard
413689d36f git.el: Add a commit description to the reflog.
Add a description of the commit to the reflog using the first line of
the log message, the same way the git-commit script does it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-19 23:27:51 -07:00
Junio C Hamano
77e6f5bc10 Merge branch 'maint'
* maint:
  Fix lseek(2) calls with args 2 and 3 swapped
  Honor -p<n> when applying git diffs
  Fix dependency of common-cmds.h
  Fix renaming branch without config file
  DESTDIR support for git/contrib/emacs
  gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patches
  Document --left-right option to rev-list.
  Revert "builtin-archive: use RUN_SETUP"
  rename contrib/hooks/post-receieve-email to contrib/hooks/post-receive-email.
  rerere: make sorting really stable.
  Fix t4200-rerere for white-space from "wc -l"
2007-04-05 16:34:51 -07:00
Ville Skyttä
1e31fbe24f DESTDIR support for git/contrib/emacs
make install DESTDIR=... support for git/contrib/emacs

Signed-off-by: Ville Skyttä <scop@xemacs.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-05 14:14:55 -07:00
Xavier Maillard
3cc5ca3923 git-blame.el: pick a set of random colors for each git-blame turn
I thought it would be cool to have different set of colors for each
git-blame-mode. Function `git-blame-new-commit' does this for us
picking when possible, a random colors based on the set we build on
startup. When it fails, `git-blame-ancient-color' will be used. We
also take care not to use the same color more than once (thank you
David Kågedal, really).

* Prevent (future possible) namespace clash by renaming `color-scale'
into `git-blame-color-scale'. Definition has been changed to be more
in the "lisp" way (thanks for help to #emacs). Also added a small
description of what it does.

* Added docstrings at some point and instructed defvar when a variable
was candidate to customisation by users.

* Added missing defvar to silent byte-compilers (git-blame-file,
git-blame-current)

* Do not require 'cl at startup

* Added more informations on compatibility

Signed-off-by: Xavier Maillard <zedek@gnu.org>
Acked-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 23:58:10 -07:00
Xavier Maillard
02f0559eba git-blame.el: separate git-blame-mode to ease maintenance
git-blame-mode has been splitted into git-blame-mode-on and
git-blame-mode-off; it now conditionnaly calls one of them depending
of how we call it. Code is now easier to maintain and to understand.

Fixed `git-reblame' function: interactive form was at the wrong
place.

String displayed on the mode line is now configurable through
`git-blame-mode-line-string` (default to " blame").

Signed-off-by: Xavier Maillard <zedek@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 23:58:10 -07:00
Alexandre Julliard
b704e589f4 git.el: Display some information about the HEAD commit.
Use git-log --pretty=oneline to print a short description of the
current HEAD (and merge heads if any) in the buffer header.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-27 12:52:41 -07:00
Alexandre Julliard
d55552f6e3 git.el: Add support for commit hooks.
Run the pre-commit and post-commit hooks at appropriate places, and
display their output if any.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-19 01:40:27 -07:00
Junio C Hamano
ed287ab7fa Merge branch 'maint'
* maint:
  git.el: Retrieve commit log information from .dotest directory.
  git.el: Avoid appending a signoff line that is already present.
  setup_git_directory_gently: fix off-by-one error
  user-manual: install user manual stylesheet with other web documents
  user-manual: fix rendering of history diagrams
  user-manual: fix missing colon in git-show example
  user-manual: fix inconsistent use of pull and merge
  user-manual: fix inconsistent example
  glossary: fix overoptimistic automatic linking of defined terms
  Documentation: s/seperator/separator/
  Adjust reflog filemode in shared repository
2007-03-10 22:07:26 -08:00
Alexandre Julliard
60fa08ed61 git.el: Retrieve commit log information from .dotest directory.
If a git-am or git-rebase is in progress, fill the commit log buffer
from the commit information found in the various files in the .dotest
directory.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10 21:58:26 -08:00