Giter Site home page Giter Site logo

git-modes's Introduction

A Git Porcelain inside Emacs

homepage | manual | faq | wiki | mastodon


Magit is an interface to the version control system Git, implemented as an Emacs package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.


Keeping its users this excited is a lot of work . If Magit makes you
more productive too, then please consider making a donation.
Thank you! — Jonas Bernoulli

Sponsor my work using Github Sponsors    Sponsor my work using Liberapay
Sponsor my work using Opencollective    Sponsor my work using PayPal

Some alternative donation methods are available.

Getting Started

If you are new to Magit, then either one of the following two articles should help understanding how it differs from other Git clients.

If you are completely new to Magit, then this article is a good visual introduction.

Almost everything that you see in Magit can be acted on by pressing some key, but that's not obvious from just seeing how Magit looks. The screenshots and accompanying text of this article explain how to perform a variety of actions on Magit's output.

Magit differs significantly from other Git interfaces, and its advantages are not immediately obvious simply from looking at a few screenshots as presented in the preceding article.

This article discusses Magit's properties in somewhat more abstract terms.

Video introductions

If you prefer video introductions, head over to that page, where find a collection of such introductions and other videos about Magit, by various creators.


Support and Contributing

Magit has many users and very few maintainers, so we kindly ask to read the appropriate guidelines before getting in contact. — Thanks!

TL;DR We now use discussions for feature requests (not issues) and prefer if you ask the community for support instead of the overworked maintainers.

Please also consider to contribute by supporting other users or by making a monetary donation. — Thanks!


Acknowledgments

Magit was started by Marius Vollmer, and is now maintained by Jonas Bernoulli and Kyle Meyer. Former maintainers are Nicolas Dudebout, Noam Postavsky, Peter J. Weisberg, Phil Jackson, Rémi Vanicat and Yann Hodique. Many more people have contributed code, suggested features or made monetary contributions.

Thanks to all of you, may (the history of) the source be with you!


Compile Test Manual NonGNU ELPA Melpa Melpa Stable

git-modes's People

Contributors

alanfalloon avatar arichiardi avatar artagnon avatar arximboldi avatar bradwright avatar darwinawardwinner avatar dato avatar dogsleg avatar eschulte avatar inkel avatar jd avatar jeremy-compostella avatar johanclaesson avatar jwiegley avatar kanru avatar kyleam avatar mgalgs avatar nonsequitur avatar npostavs avatar petere avatar philjackson avatar pjweisberg avatar praet avatar pureabstract avatar rafl avatar ruediger avatar sensorflo avatar smarter avatar swsnr avatar tarsius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-modes's Issues

with-editor minor annoyance

Hello,

If you use TRAMP like /scpx:host.com:somefile then with-editor tries to use it like /scpx:[email protected] which fails.

If you first use TRAMP like /scpx:[email protected]:somefile then with-editor behaves correctly. Not sure if there's something to be done, tell me if you want some investiguation.

Initial insertion point is wrong

If I make a second commit in a repo, the initial insertion point in the buffer is not at the beginning of the buffer: the point is usually in the middle of the commit boilerplate comment.

I guess that the COMMIT_EDITMSG file is being kept open between edits, and that the point is somehow being restored after the commit skeleton is inserted...

Don't automatically modify `auto-mode-alist`

Simply loading the libraries defined here should not add new entries to auto-mode-alist. Instead we should add functions that do so and tell users to call these functions in their init file.

For a rational see purcell/elisp-slime-nav#6 (comment) the gist of which is (by @purcell):

A package can become available (autoloads and all) on a system in all sorts of ways. It would be inappropriate to assume that it always becomes available as a result of user's explicit choice to download a package using package.el. Therefore availability and activation should be separate.

One example for this is how magit requires git-commit-mode. This makes sense for most users, and requiring that file is okay. However it should be possible for a user to not use git-commit-mode (or any special mode for that matter) without jumping through hoops. There is at least one user who doesn't want to use the mode, see magit/magit#826.

However I think that this mode should be enabled by default for users of magit. But there should be way to disable this.

I intend to implement this by adding a git-commit-register-mode function which modifies auto-mode-alist but does not get called by just loading git-commit-mode. Since we also want it possible to use another commit mode a magit-commit-mode option will be added. Setting that to anything but git-commit-mode will prevent git-commit-register-mode from being run (initially the only other valid value will be nil).

For git-rebase-mode do something similar. For the other libraries just tell their users in the library commentaries and the README to call the git*-register-mode functions in their init file.

M-p and M-n have strange behaviour

I have 2 scenarios, using the following file called test.el to setup the message log ring:

(add-to-list 'load-path (file-name-directory load-file-name))
(load "git-commit-mode.el")

; be quiet!
(defun yes-or-no-p (prompt) (interactive) t)
(setq auto-save-default nil)

(when (file-exists-p "COMMIT_EDITMSG")
  (delete-file "COMMIT_EDITMSG"))
(find-file "COMMIT_EDITMSG")
(insert "one")
(insert "\n\n#comment one\n")
(git-commit-abort)

(delete-file "COMMIT_EDITMSG")
(find-file "COMMIT_EDITMSG")
(insert "two")
(insert "\n\n#comment two\n")
(git-commit-abort)

(delete-file "COMMIT_EDITMSG")
(find-file "COMMIT_EDITMSG")
(insert "three")
(insert "\n\n#comment three\n")
(git-commit-abort)

(delete-file "COMMIT_EDITMSG")
(find-file "COMMIT_EDITMSG")
(insert "\n\n#auto comment\n")
  1. Run emacs -Q -l test.el. Press M-p to get the previous message ("three"), you decide that it's not useful so you press M-n to go back... but you get a different message ("one")!

    I think this is because of ec3775e, maybe it's even on purpose? It feels very strange to me.

  2. Run emacs -Q -l test.el. Start typing a commit message, you decide to go back to a previous message, but pressing M-p leaves you on the same message you're writing! You have to press M-p twice to get back to "three".

    Note sure why this is happening, needs more investigation.

Provide some hand holding during interactive rebase

When doing interactive rebase git helpfully prints

Stopped at xxx.. <commit-message>
You can amend the commit now, with

    git commit --amend

Once you are satisfied with your changes, run

    git rebase --continue

It would be nice if magit could provide similar guidance for those who, like myself, are easily confused. I think I have at least twice now started an interactive rebase from magit, and after marking commits to be edited, forgotten what the next step was.

`with-editor` help

Hello,

I tried to use with-editor in order to edit crontab over TRAMP... didn't succeed much, here is what I tried:

(with-editor "EDITOR" (start-file-process "test" (get-buffer-create "*test*") "crontab" "-e"))

Do you know what I missed?

Also, making an interactive method like M-x with-editor RET crontab -e RET would be awesome!

Split font lock keywords

Split font lock keywords into multiple levels:

  • gitignore-mode: Move glob patterns to level 2 and directory separators to level 3.
  • gitconfig-mode: Move keys, booleans and numbers to level 2
  • git-commit-mode: Move branch, action and header highlighting to level 2, and summary highlighting to level 3

overwriting magit should be configurable?

I used this for a while, it was hell to remove. Took me ages to find again.

That's because there is no config or variable for turning it on, it's just on. When I was looking to turn it off I thought it must be some magit hooks... but no.

Maybe you should make a config var for it to be turned on or off instead of just over writing magit functionality?

Pressing enter in git-rebase-mode errors

When pressing enter in git-rebase-mode I get the following error:

Debugger entered--Lisp error: (wrong-number-of-arguments #[(commit &optional noselect inhibit-history) "\306\307\310�#\204
\311\312�\"\210\313 \314    !��r
q\210\204(
��B��B��\315��eb\210\316
��\2036\317\2027\320\"\210\321�\322\323�$+\207" [commit magit-commit-buffer-name buf dir inhibit-history default-directory magit-git-success "cat-file" "commit" error "%s is not a commit" magit-get-top-dir get-buffer-create nil magit-mode-display-buffer display-buffer pop-to-buffer magit-mode-init magit-commit-mode magit-refresh-commit-buffer magit-currently-shown-commit magit-back-navigation-history magit-forward-navigation-history noselect] 5 ("/Users/ivanandres/.emacs.d/elpa/magit-20131126.621/magit.elc" . 178183) (list (magit-read-rev-with-default "Show commit (hash or ref)"))] 4)
  magit-show-commit(#("1502945" 0 7 (fontified t face font-lock-builtin-face)) nil nil select)
  git-rebase-show-commit(nil)
  call-interactively(git-rebase-show-commit nil nil)
  command-execute(git-rebase-show-commit)

I reinstalled git-rebase-mode from MELPA, and when compiling it gives the following warning:

In git-rebase-show-commit:
git-rebase-mode.el:317:16:Warning: magit-show-commit called with 4 arguments,
    but accepts only 1-3

Treat comments as comments

In commit messages lines starting with # only look like comments, but Emacs does not know that they are comments.

This is a problem when using fill-paragraph and there is no empty line between the message and the boilerplate comment. Speaking of which; even once that is fixed we should also inject that extra empty line in cases git does not do it - it just looks better.

`File mode specification error: (void-function nil)` error

When use git-commit-mode with emacsclient, I get the error message File mode specification error: (void-function nil).

The failure occurs during the call to diff-mode. Code after this call does not get applied. (turn-on-auto-fill, for example.)

To repoduce:

~/.emacs.d/init.el

(require 'package)
(add-to-list 'package-archives
  '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
(server-start)

Install git-commit-mode package. Restart emacs.

In a terminal, set EDITOR to emacsclient and run git commit -v.

GNU Emacs 24.3.50.1 (i386-apple-darwin12.4.0, NS apple-appkit-1187.39)
git-commit-mode-20130719.2054 (from melpa)

Merging git-{commit,rebase}-mode and with-editor into Magit

I intend to move git-commit-mode, git-rebase-mode and with-editor from magit/git-modes to magit/magit. That will be done in two steps (1) create a branch which removes all other files (2) merge that branch into Magit's next branch. Magit's history will then have two root commits.

When I decided to keep git-commit-mode inside git-modes and even move magit-rebase-mode there under its new name git-rebase-mode it wasn't obvious yet that the integration between Magit and git-{commit,rebase}-mode would increase as much as it did. A lot of that is done using the new library with-editor which deals with making the current Emacs instance usable as $GIT_EDITOR (which was previously done in Magit) and abstracts code previously duplicated in git-commit-mode and git-rebase-mode, and improves upon that.

Magit no longer just binds a few keys to commands from git-{commit,rebase}-mode. It is no longer possible to replace these libraries with equivalent third-party libraries (not that any suitable ones ever existed). Also they are mandatory now, not only would one lose major features if they were not present, Magit would not even compile without them.

The opposite is not true, git-commit-mode and git-rebase-mode work just fine without Magit, and I do not intend to change that. with-editor does not require Magit or these libraries, in fact it doesn't even care about Git itself.

So yes, it was a mistake to have these libraries in a separate repository but having made a mistake shouldn't keep us from fixing it. Doing so will make development easier and it will also make the bug reports stop, that are the result of users forgetting to update git-modes when updating magit. As more people switch to Magit's next branch when it enters the beta phase later this year, such invalid bug reports would rise to an annoying level.


I am also considering renaming git-commit-mode.el to git-commit.el and git-rebase-mode.el to git-rebase.el, as library names are not supposed to end with -mode. In the case of git-commit-mode.el keeping the old names would be especially strange because git-commit-mode now only plays a very marginal role, it's a minor-mode now which is only turned on for its keymap.


Finally I would like to change the copyright notice in the moved libraries to be like that of other libraries that are already part of magit/magit by applying this patch:

diff --git a/git-commit-mode.el b/git-commit-mode.el
index 7a3dbb6..2ea5047 100644
--- a/git-commit-mode.el
+++ b/git-commit-mode.el
@@ -1,11 +1,13 @@
 ;;; git-commit-mode.el --- edit Git commit messages  -*- lexical-binding: t; -*-

-;; Copyright (c) 2010-2012  Florian Ragwitz
-;; Copyright (c) 2012-2013  Sebastian Wiesner
 ;; Copyright (C) 2010-2014  The Magit Project Developers
+;;
+;; For a full list of contributors, see the AUTHORS.md file
+;; at the top-level directory of this distribution and at
+;; https://raw.github.com/magit/magit/master/AUTHORS.md

 ;; Authors: Jonas Bernoulli <[email protected]>
 ;;     Sebastian Wiesner <[email protected]>
 ;;     Florian Ragwitz <[email protected]>
 ;; Maintainer: Jonas Bernoulli <[email protected]>
 ;; Homepage: https://github.com/magit/git-modes

@lunaryorn and @rafl, are you okay with that?

Add changelog like stub into commit message

Allow inserting a changelog like stub into commit messages. Users should be able to do so using either a command (invoked from the commit message buffer) or by adding a hook.

How many package[.el]s?

We are currently building four Melpa packages from this repository, one for each library. There are other ways the repository could (not) be split into packages. Since we have just added a new library, it might be a good time to think about this now.

I can see the following alternatives:

  1. One package only.
  2. One package per library (add a new package for gitattributes-mode.
  3. One package for the git{config,ignore,attributes}-mode. One for commit. One for rebase.

I would prefer (3): I don't think it is likely someone would want to use only one of git{config,ignore,attributes}-mode. On the other hand I can see how someone would only want the former or git-rebase-mode and/or git-commit-mode.

How to disable flyspell?

git-commit-mode enables spell checking, which I never want. Is there a way to turn that off?

I'm quite new to emacs and lisp, so pardon me if this is a simple question.

Installation steps for git-modes

I've tried searching the website, this repository, StackExchange, etc. and haven't found any easy installation instructions. I'm guessing installation is intended to be "copy the files and load them in your .emacs". If that's the case, could we add a line saying so to the README? If there's another way (via Melpa or otherwise) then I'd love to hear about it, because I can't find anything.

I assumed this would be available either via Melpa (or another package repository) or included in magit, but I don't think either of those are true.

with-editor: TODO

Hello,

Instead of creating thousands of tickets, and to keep track of all of what was said, here is a list of the things that are still pending:

  • investigate ansi-colors disappearing (doesn't happen anymore)
  • whether we care about the fact that the variable eshell-preoutput-filter-functions is permanently changed once we use with-editor in eshell.
  • whether we really need to call (with-editor-mode 1) from git-commit-mode (9fe62b1) (yes)
  • term: how to execute "invisible" commands
  • shell: how to execute "invisible" commands
  • eshell: how to execute "invisible" commands
  • whether the check against file-name-absolute-p is really necessary in with-editor-output-filter (e84cb72)
  • whether we should use file-remote-p or tramp-tramp-file-p (#96)
  • whether we should add with-editor-export-hg-editor (a6d4398)
  • or whether we should remove with-editor-export-git-editor
  • compile a list of "override $EDITOR variables" in common use.
  • whether we should just add with-editor-mode to server-visit-hook and be done with it
  • or whether we should instead implement global-with-editor-mode and (global-) shell-with-editor-mode, and sprinkle conditionals all over the code.

Related discussions: #91, #92, #96, #102, #108, #112, #116

# in the middle of a line is filled like a comment

Starting with this COMMIT_EDITMSG

top line...

A typical commit message referencing issue #xxx that is long enough to need filling,

emacs -Q -L . -l git-commit-mode.el COMMIT_EDITMSG, move to the second line and press M-q (fill-paragraph), results in (I untabified it):

A typical commit message referencing issue #xxx that is long enough to
                                           #need filling,

Moving to the end and pressing space (triggering auto-fill) results in:

A typical commit message referencing issue #xxx that is long enough to
#need filling, 

Put up a recent version of git-modes on melpa-stable

For various reasons, many of us choose to not use melpa.

For the longest time, the only alternative to melpa was marmalade, and I can understand that not every package wants upload to marmalade. However, a few days ago, @milkypostman introduced melpa-stable. Melpa-stable works the same way as melpa, but takes tagged version instead of HEAD.

I would be very grateful if you could tag a recent version of git-modes, and thus make it available on melpa-stable.

This is particularly pressing, since magit recently did the same, but relies on git-modes v0.14 to be installed, which is currently only available from melpa (non-stable).

git-commit-mode overrides magit-log-edit-mode.

Okay the title doesn't make sense since overwriting is intentional.

But my problem is with git-commit-commit function which is overwriting rather more competent magit-log-edit-commit.

for example previously when I try to commit, magit checks if there is a rebase in pending, but now I loose that check..

I am not familiar with history of this mode,. When I come to know about this library My first intuition was its a minor mode which hooks into magit-log-mode to correct my commit logs. I was obviously wrong.

Please change title accordingly..

PS; haven't read the source clearly, possible that my above assumption are not right.

Thanks

auto-mode-alist with duplicated elements

There is one trivial bug for the three elisp files: auto-mode-alist is appended rather than used with add-to-list, which works fine if it has not been evaluated more than once. The problems lies that when you also give a hint that it is autoloaded, then once the autoloads files is generated, there would be another expression. When the specified mode is loaded, the expression is evaluated again, which appends auto-mode-alist with a duplicated entry.

For instance, in gitignore-mode.el, the code below will also appear in gitignore-mode-autoloads.el if the package is managed by package.el.

(setq auto-mode-alist
      (append '(("/\\.gitignore\\'" . gitignore-mode)
                ("/\\.git/info/exclude\\'" . gitignore-mode))
              auto-mode-alist))

When gitignore-mode is loaded, auto-mode-alist would have two entries for /\\.gitignore\\'.So I guess we should use the code below instead in gitignore-mode.el:

;;;###autoload
(progn (add-to-list 'auto-mode-alist '("/\\.gitignore\\'" . gitignore-mode))
       (add-to-list 'auto-mode-alist '("/\\.git/info/exclude\\'" . gitignore-mode)))

Thanks.

C-c C-h is not a good prefix command (git-commit-mode)

I just installed git-commit-mode. It seemacs all the commands are prefixed with C-c C-h which I think is not good choice.

For me C-c C-h is bringing help buffer showing all possible commands with prefix C-c. I think its expected and consistent throughout the Emacs.

IMHO C-h should not be used for prefix, If you disagree then I would request you to make it configurable.

Thanks

git-commit-abort saves COMMIT_EDITMSG

Not sure if this is the right place to report this. I have emacs -nw set as my editor in git config. Running git commit correctly opens emacs in-place in my gnome-terminal. When I press C-c C-k for kill, or when I invoke similar commands, such as git-commit-abort, the file .git/COMMIT_EDITMSG is written. That means, the commit actually goes ahead, which is not intended.

Rather, I expect the content to be stored "somewhere", and is then accessible next time I invoke git commit from the same repository.

Add easy way to build

This repository needs a build system of sorts. I see two options:

  1. Port Magit's
  2. Use cask.el

`git-rebase-show-commit' is broken

When rebasing interactively, hitting RET (`git-rebase-show-commit')
on an action line fails with the following backtrace:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  find-file-name-handler(nil process-file)
  process-file("git" nil nil nil "--no-pager" "log" "--no-abbrev-commit" "-n" "0")
  apply(process-file "git" nil nil nil ("--no-pager" "log" "--no-abbrev-commit" "-n" "0"))
  magit-git-exit-code("log" "--no-abbrev-commit" "-n" "0")
  (= 0 (magit-git-exit-code "log" "--no-abbrev-commit" "-n" "0"))
  (setq magit-have-abbrev (= 0 (magit-git-exit-code "log" "--no-abbrev-commit" "-n" "0")))
  (progn (setq magit-have-abbrev (= 0 (magit-git-exit-code "log" "--no-abbrev-commit" "-n" "0"))))
  (if (eq magit-have-abbrev (quote unset)) (progn (setq magit-have-abbrev (= 0 (magit-git-exit-code "log" "--no-abbrev-commit" "-n" "0")))))
  (when (eq magit-have-abbrev (quote unset)) (setq magit-have-abbrev (= 0 (magit-git-exit-code "log" "--no-abbrev-commit" "-n" "0"))))
  magit-configure-have-abbrev()
  magit-refresh-commit-buffer(#("318e5ac" 0 7 (fontified t face font-lock-builtin-face)))
  apply(magit-refresh-commit-buffer #("318e5ac" 0 7 (fontified t face font-lock-builtin-face)))
  (progn (apply magit-refresh-function magit-refresh-args))
  (if magit-refresh-function (progn (apply magit-refresh-function magit-refresh-args)))
  (when magit-refresh-function (apply magit-refresh-function magit-refresh-args))
  (let ((section-line (and old-section (count-lines (magit-section-beginning old-section) (point)))) (line-char (- old-point (point)))) (when magit-refresh-function (apply magit-refresh-function magit-refresh-args)) (magit-refresh-marked-commits-in-buffer) (let ((s (and old-path (magit-find-section old-path magit-top-section)))) (cond (s (goto-char (magit-section-beginning s)) (forward-line section-line) (forward-char line-char)) (t (save-restriction (widen) (goto-char (point-min)) (forward-line (1- old-line))))) (dolist (w (get-buffer-window-list (current-buffer))) (set-window-point w (point))) (magit-highlight-section)))
  (let* ((old-line (line-number-at-pos)) (old-point (point)) (old-section (magit-current-section)) (old-path (and old-section (magit-section-path (magit-current-section))))) (beginning-of-line) (let ((section-line (and old-section (count-lines (magit-section-beginning old-section) (point)))) (line-char (- old-point (point)))) (when magit-refresh-function (apply magit-refresh-function magit-refresh-args)) (magit-refresh-marked-commits-in-buffer) (let ((s (and old-path (magit-find-section old-path magit-top-section)))) (cond (s (goto-char (magit-section-beginning s)) (forward-line section-line) (forward-char line-char)) (t (save-restriction (widen) (goto-char (point-min)) (forward-line (1- old-line))))) (dolist (w (get-buffer-window-list (current-buffer))) (set-window-point w (point))) (magit-highlight-section))))
  (save-current-buffer (set-buffer (or buffer (current-buffer))) (let* ((old-line (line-number-at-pos)) (old-point (point)) (old-section (magit-current-section)) (old-path (and old-section (magit-section-path (magit-current-section))))) (beginning-of-line) (let ((section-line (and old-section (count-lines (magit-section-beginning old-section) (point)))) (line-char (- old-point (point)))) (when magit-refresh-function (apply magit-refresh-function magit-refresh-args)) (magit-refresh-marked-commits-in-buffer) (let ((s (and old-path (magit-find-section old-path magit-top-section)))) (cond (s (goto-char (magit-section-beginning s)) (forward-line section-line) (forward-char line-char)) (t (save-restriction (widen) (goto-char ...) (forward-line ...)))) (dolist (w (get-buffer-window-list (current-buffer))) (set-window-point w (point))) (magit-highlight-section)))))
  (with-current-buffer (or buffer (current-buffer)) (let* ((old-line (line-number-at-pos)) (old-point (point)) (old-section (magit-current-section)) (old-path (and old-section (magit-section-path (magit-current-section))))) (beginning-of-line) (let ((section-line (and old-section (count-lines (magit-section-beginning old-section) (point)))) (line-char (- old-point (point)))) (when magit-refresh-function (apply magit-refresh-function magit-refresh-args)) (magit-refresh-marked-commits-in-buffer) (let ((s (and old-path (magit-find-section old-path magit-top-section)))) (cond (s (goto-char (magit-section-beginning s)) (forward-line section-line) (forward-char line-char)) (t (save-restriction (widen) (goto-char ...) (forward-line ...)))) (dolist (w (get-buffer-window-list (current-buffer))) (set-window-point w (point))) (magit-highlight-section)))))
  magit-refresh-buffer()
  magit-mode-init(nil magit-commit-mode magit-refresh-commit-buffer #("318e5ac" 0 7 (fontified t face font-lock-builtin-face)))
  (save-current-buffer (set-buffer buf) (unless inhibit-history (push (cons default-directory magit-currently-shown-commit) magit-back-navigation-history) (setq magit-forward-navigation-history nil)) (setq magit-currently-shown-commit commit) (goto-char (point-min)) (magit-mode-init dir (quote magit-commit-mode) (function magit-refresh-commit-buffer) commit))
  (with-current-buffer buf (unless inhibit-history (push (cons default-directory magit-currently-shown-commit) magit-back-navigation-history) (setq magit-forward-navigation-history nil)) (setq magit-currently-shown-commit commit) (goto-char (point-min)) (magit-mode-init dir (quote magit-commit-mode) (function magit-refresh-commit-buffer) commit))
  (cond ((and (equal magit-currently-shown-commit commit) (with-current-buffer buf (> (length (buffer-string)) 1))) (let ((win (get-buffer-window buf))) (cond ((not win) (display-buffer buf)) (scroll (with-selected-window win (funcall scroll)))))) (commit (display-buffer buf) (with-current-buffer buf (unless inhibit-history (push (cons default-directory magit-currently-shown-commit) magit-back-navigation-history) (setq magit-forward-navigation-history nil)) (setq magit-currently-shown-commit commit) (goto-char (point-min)) (magit-mode-init dir (quote magit-commit-mode) (function magit-refresh-commit-buffer) commit))))
  (let ((dir (magit-get-top-dir)) (buf (get-buffer-create magit-commit-buffer-name))) (cond ((and (equal magit-currently-shown-commit commit) (with-current-buffer buf (> (length (buffer-string)) 1))) (let ((win (get-buffer-window buf))) (cond ((not win) (display-buffer buf)) (scroll (with-selected-window win (funcall scroll)))))) (commit (display-buffer buf) (with-current-buffer buf (unless inhibit-history (push (cons default-directory magit-currently-shown-commit) magit-back-navigation-history) (setq magit-forward-navigation-history nil)) (setq magit-currently-shown-commit commit) (goto-char (point-min)) (magit-mode-init dir (quote magit-commit-mode) (function magit-refresh-commit-buffer) commit)))) (when select (pop-to-buffer buf)))
  magit-show-commit(#("318e5ac" 0 7 (fontified t face font-lock-builtin-face)) nil nil select)
  (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit)))
  (let ((commit (match-string 2))) (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit))))
  (progn (let ((commit (match-string 2))) (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit)))))
  (if (looking-at git-rebase-action-line-re) (progn (let ((commit (match-string 2))) (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit))))))
  (when (looking-at git-rebase-action-line-re) (let ((commit (match-string 2))) (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit)))))
  (save-excursion (goto-char (point-at-bol)) (when (looking-at git-rebase-action-line-re) (let ((commit (match-string 2))) (if (fboundp (quote magit-show-commit)) (magit-show-commit commit nil nil (quote select)) (with-current-buffer (get-buffer-create (format "*git-rebase--commit-%s*" commit)) (shell-command (concat "git show " commit)) (setq buffer-read-only t) (set-buffer-modified-p nil) (diff-mode)) (pop-to-buffer (format "*git-rebase--commit-%s*" commit))))))
  git-rebase-show-commit(nil)
  call-interactively(git-rebase-show-commit nil nil)

Clash with session.el in Emacs 23

session.el has its (provide 'session) at the top of the file, so when git-commit-mode's eval-after-load clause executes, 'session-mode-disable-list is undefined. It looks like Emacs 23.3.1 (at least) runs the eval-after-load code immediately when the provide is executed. :-/

Not sure what our chances are of getting session.el updated upstream.

Moving commits around

When rebasing it's possible to change the order of commits (by moving around the pick). It seems not possible with git-rebase-mode enabled (which is a shame).

A few shortcuts (M-S-, M-S- ; like org-mode) to be able to move commits around would be super cool.

Relationship with magit

Hi,

the relationship between git-modes and magit is not clear. Do I need both? Does one depend on the other?

Changes meaning of C-c C-a

I used to use C-c C-a daily to amend commits locally, but I see that git-commit-mode now seems to bind it to "ack"-ing a commit, which I've never used before.

I'm probably not the only one who will be confused by this. Any chance we could switch it back?

Use markdown

Go back to markdown for CONTRIBUTING and README, Org formatting on Github is broken.

`with-editor-mode` not set when using with-editor locally

Hello,

M-x shell
M-x with-editor-export-editor
crontab -e

The resulting buffer is not in with-editor-mode. I'm not sure where we are supposed to do that because for git-commit-mode you use git-commit-setup-check-buffer inside a find-file-hook, but for editors spawned by emacsclient for with-editor it's hard to know who called this originally.

I tried to hack my way into using the -e flag of emacsclient to enable (with-editor-mode) there directly, but I think you need to wrap it inside some wrapper function. Here is where I stopped trying (calling with-editor foo.txt works fine but the export fails):

with_editor() { 
  /usr/local/bin/emacsclient \
    --socket-name=/tmp/emacs1000/server \
    -e "(progn (find-file \"$1\") (with-editor-mode))"; 
}
export -f with_editor
export EDITOR=with_editor

Allow easier customization of `git-commit-summary-regexp`

The regexp used to check the validity of the commit summary (that is, the first line of the changelog) is currently defined as a defconst, and thus it is not so easily customizable.

For example, I find the default size (50 chars) a bit too short, and I'd like to allow say 70 chars: the only way seems to be editing the git-commit-mode.el source.

Sebastian Wiesner said:

You aren't missing any trick, there is currently no way to customize
this. I am not opposed to adding such an option though, the whole
summary highlight things needs a refactoring anyway.

magit-edit-log window not closed when using git-commit-mode

The magit-edit-log window stays open after committing code with C-c C-c when git-commit-mode is enabled. This is in contrast to vanilla magit, which closes the log-edit window immediately after commiting code with C-c C-c.

The following temporary hack fixes the problem for me:

diff --git a/git-commit-mode.el b/git-commit-mode.el
index 891696e..b14af18 100644
--- a/git-commit-mode.el
+++ b/git-commit-mode.el
@@ -590,9 +590,10 @@ basic structure of and errors in git commit messages."
       (substitute-key-definition 'magit-log-edit-toggle-signoff
                                  'git-commit-signoff
                                  magit-log-edit-mode-map)
-      (substitute-key-definition 'magit-log-edit-commit
-                                 'git-commit-log-edit-commit
-                                 magit-log-edit-mode-map)))
+      ;; (substitute-key-definition 'magit-log-edit-commit
+      ;;                            'git-commit-log-edit-commit
+      ;;                            magit-log-edit-mode-map)
+      ))

 ;;;###autoload
 (setq auto-mode-alist

Proper attributions

We should attribute contributions similar to how we do for Magit, instead of doing it manually. I should not be mentioned as only maintainer.

But considering that I will split up this repository it is okay to delay doing so - to avoid work which would be obsolete after the split.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.