summaryrefslogtreecommitdiff
path: root/contrib/emacs
Commit message (Collapse)AuthorAgeFilesLines
* emacs: make 'git-status' work with separate git dirsEnrico Scholz2012-11-261-1/+1
| | | | | | | | | | | | | | | | when trying 'M-x git-status' in a submodule created with recent (1.7.5+) git, the command fails with | ... is not a git working tree This is caused by creating submodules with '--separate-git-dir' but still checking for a working tree by testing for a '.git' directory. The patch fixes this by relaxing the existing detection a little bit. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'lm/git-blame-el'Junio C Hamano2012-06-251-36/+37
|\ | | | | | | | | | | | | | | | | eLisp fixes for a contrib/ script. * lm/git-blame-el: git-blame.el: Do not use bare 0 to mean (point-min) git-blame.el: Use with-current-buffer where appropriate git-blame.el: Do not use goto-line in lisp code
| * git-blame.el: Do not use bare 0 to mean (point-min)Lawrence Mitchell2012-06-141-1/+1
| | | | | | | | | | Signed-off-by: Lawrence Mitchell <wence@gmx.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-blame.el: Use with-current-buffer where appropriateLawrence Mitchell2012-06-141-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In git-blame-filter and git-blame-create-overlay we want to save (along with the values of point and mark) the current-buffer in scope when calling the functions. The idiom (save-excursion (set-buffer buf) ...) will correctly restore the correct buffer, but will not save the values of point and mark in buf (only in the buffer current when the save-excursion call is executed). The intention of these functions is to save the current buffer from the calling scope and the values of point and mark in the buffer they are modifying. The correct idiom for this is (with-current-buffer buf (save-excursion ...)) Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de> Signed-off-by: Lawrence Mitchell <wence@gmx.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * git-blame.el: Do not use goto-line in lisp codeRüdiger Sonderfeld2012-06-141-1/+2
| | | | | | | | | | | | | | | | | | goto-line is a user-level command, instead use the lisp-level construct recommended in Emacs documentation. Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de> Signed-off-by: Lawrence Mitchell <wence@gmx.li> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-blame.el: use mapc instead of mapcarRüdiger Sonderfeld2012-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Using mapcar here is a waste of memory because the mapped result is not used. Noticed by emacs ("Warning: `mapcar' called for effect"). [jn: split from a larger patch, with new description] Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git.el: Don't use font-lock-compile-keywordsLawrence Mitchell2011-04-031-3/+10
|/ | | | | | | | | | | | | If font-lock is disabled, font-lock-compile-keywords complains. Really what we want to do is to replace log-edit's font-lock definitions with our own, so define a major mode deriving from log-edit and set up font-lock-defaults there. We then use the optional MODE argument to log-edit to set up the major mode of the commit buffer appropriately. Signed-off-by: Lawrence Mitchell <wence@gmx.li> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-blame.el: Add (require 'format-spec)David Kågedal2010-11-031-0/+1
| | | | | | | | | | | | | | | | | | c5022f57 (git-blame.el: Change how blame information is shown, 2009-09-29) taught the "M-x git-blame" mode to format its output in a more interesting way, making use of the format-spec function. format-spec is included in Emacs 23 and is a useful function. Older emacsen can get it from Gnus. In all emacsen, we need to 'require it before use to avoid warnings: git-blame.el:483:1:Warning: the function `format-spec' is not known to be defined. Reported-by: Sergei Organov <osv@javad.com> Reported-by: Kevin Ryde <user42@zip.com.au> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-blame.el: Change how blame information is shown.David Kågedal2009-09-291-54/+102
| | | | | | | It is more customizable, and uses a line prefix to show the commit. Signed-off-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* git.el: Use git-add-file for unmerged files, remove git-resolve-fileMartin Nordholts2009-09-091-12/+1
| | | | | | | | | | | Use `git-add-file' to mark unmerged files as resolved in the *git-status* buffer to be consistent with git's CLI instructions. Also remove `git-resolve-file' to make it clear that that "R" is a now a free keybinding. Signed-off-by: Martin Nordholts <martinn@src.gnome.org> Acked-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git.el: Clarify documentation of git-commit-treeDavid Kågedal2009-08-061-5/+8
| | | | | Signed-off-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Add a README in the contrib/emacs directory.Alexandre Julliard2009-02-211-0/+39
| | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Improve the confirmation message on remove and revert.Alexandre Julliard2009-02-211-2/+6
| | | | | | If there's only one file, print its name instead of just "1 file". Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Make sure that file lists are sorted as they are created.Alexandre Julliard2009-02-211-13/+16
| | | | | | | | | | | 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>
* emacs: Remove the no longer maintained vc-git package.Alexandre Julliard2009-02-072-217/+1
| | | | | | | | 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>
* git.el: Add some notes about Emacs versions compatibility.Alexandre Julliard2009-02-071-2/+10
| | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Use integer instead of character constants in case statement.Alexandre Julliard2009-02-071-15/+15
| | | | | | This is for compatibility with XEmacs. Reported by Vassili Karpov. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Set a regexp for paragraph-separate in log-edit mode.Alexandre Julliard2009-02-071-0/+1
| | | | | | | This allows using fill-paragraph on the log message without interference from the various header fields. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Make git-run-command-region display the error if any.Alexandre Julliard2009-02-071-19/+19
| | | | | | This makes it easier to figure out why a commit has failed. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Add commands for cherry-pick and revert.Alexandre Julliard2009-02-071-0/+42
| | | | | | | | 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>
* git.el: Add a command to create a new branch.Alexandre Julliard2009-02-071-0/+14
| | | | | | | | | 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>
* git.el: Add a checkout command.Alexandre Julliard2009-02-071-2/+31
| | | | | | | | | 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>
* git.el: Allow to commit even if there are no marked files.Alexandre Julliard2008-11-231-23/+20
| | | | | | | This can be useful to commit a merge that didn't result in any changes. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Add possibility to mark files directly in git-update-status-files.Alexandre Julliard2008-11-231-5/+3
| | | | | | | 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>
* git.el: Add an insert file command.Alexandre Julliard2008-11-231-0/+7
| | | | | | | 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>
* git.el: Never clear the status buffer, only update the files.Alexandre Julliard2008-11-211-84/+85
| | | | | | This makes it unnecessary to save/restore the file marks. Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Fix git-amend-commit to support amending an initial commit.Alexandre Julliard2008-11-211-3/+7
| | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Properly handle merge commits in git-amend-commit.Alexandre Julliard2008-11-211-8/+9
| | | | Signed-off-by: Alexandre Julliard <julliard@winehq.org>
* git.el: Simplify handling of merge heads in the commit log-edit buffer.Alexandre Julliard2008-11-211-8/+7
| | | | | | | | 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>
* git.el: Remove the env parameter in git-call-process and ↵Alexandre Julliard2008-11-211-28/+26
| | | | | | | | | 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>
* git.el: Improve error handling for commits.Alexandre Julliard2008-11-211-17/+29
| | | | | | | 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>
* Don't cut off last character of commit descriptions.Nikolaj Schumacher2008-07-211-1/+1
| | | | | | | | | | This should have been part of 24a2293 (git-blame.el: show the when, who and what in the minibuffer., 2008-02-12), that changed from using --pretty=oneline to --pretty=format:... without terminating newline. Acked-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rename .git/rebase to .git/rebase-applyJohannes Schindelin2008-07-211-4/+4
| | | | | | | | | | With git-am, it sounds awkward to have the patches in ".git/rebase/", but for technical reasons, we have to keep the same directory name for git-am and git-rebase. ".git/rebase-apply" seems to be a good compromise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Rename ".dotest/" to ".git/rebase" and ".dotest-merge" to "rebase-merge"Johannes Schindelin2008-07-151-4/+4
| | | | | | | | | | | Since the files generated and used during a rebase are never to be tracked, they should live in $GIT_DIR. While at it, avoid the rather meaningless term "dotest" to "rebase", and unhide ".dotest-merge". This was wished for on the mailing list, but so far unimplemented. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Revert "git.el: Set process-environment instead of invoking env"Karl Hasselström2008-06-021-4/+7
| | | | | | | | | 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>
* git.el: Set process-environment instead of invoking envClifford Caoile2008-04-211-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* specify explicit "--pretty=medium" with `git log/show/whatchanged`Denis Cheng2008-03-051-1/+1
| | | | | | | | | | | 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>
* Merge branch 'maint'Junio C Hamano2008-02-291-1/+1
|\ | | | | | | | | | | | | * 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
| * git.el: find the git-status buffer whatever its name isRémi Vanicat2008-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* | git.el: Do not display empty directories.Alexandre Julliard2008-02-271-1/+1
| | | | | | | | | | | | 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>
* | git.el: Set process-environment instead of invoking envDavid Kågedal2008-02-201-4/+3
| | | | | | | | | | | | | | | | | | | | 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>
* | git-blame.el: show the when, who and what in the minibuffer.Junichi Uekawa2008-02-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | 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>
* | git.el: Better handling of subprocess errors.Alexandre Julliard2008-02-081-37/+51
| | | | | | | | | | | | | | | | 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>
* | git.el: Check for existing buffers on revert.Alexandre Julliard2008-02-081-0/+8
| | | | | | | | | | | | | | | | | | 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>
* | git.el: Added a command to amend a commit.Alexandre Julliard2008-02-081-1/+73
| | | | | | | | | | | | | | | | 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>
* | git.el: Support for showing unknown/ignored directories.Alexandre Julliard2008-02-081-9/+29
|/ | | | | | | | | 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>
* git.el: Make status refresh faster.Alexandre Julliard2008-01-081-11/+13
| | | | | | | | | | | | 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>
* git.el: Refresh files from their real state upon commit.Alexandre Julliard2008-01-081-10/+12
| | | | | | | | 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>
* git.el: Make sure we never insert the same file twice.Alexandre Julliard2008-01-081-3/+3
| | | | | | | | 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>
* git.el: Display file types and type changes.Alexandre Julliard2008-01-061-3/+31
| | | | | | | | | 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>