aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-commit.el
AgeCommit message (Collapse)Author
2026-03-30magit-commit-diff--{args,show}: New functionsJonas Bernoulli
Split up `magit-commit-diff-1'.
2026-03-30Use cond more instead of if and prognJonas Bernoulli
2026-03-29Make Cond-Let's when$ availableJonas Bernoulli
2026-03-22magit-commit: Insert inline diff by defaultJonas Bernoulli
It is collapsed by default, so enabling this by default isn't much of a distraction.
2026-02-26magit-commit-diff: Tweak a commentJonas Bernoulli
2026-02-26magit-commit-diff: Do not error outside Git repositoryJonas Bernoulli
Closes #5526.
2026-02-21magit-commit-diff: Demote errorsJonas Bernoulli
An error while preparing the diff (e.g., due to a bug such as #5524) should not prevent the creation of a commit. We already do the same for errors that trigger when running `git-commit-setup-hook', but this function is run via other hooks.
2026-02-21magit-commit-diff-1: Fix amending to initial commitJonas Bernoulli
Closes #5524.
2026-01-11magit-buffer-diff-typearg: Renamed variableJonas Bernoulli
2026-01-11magit-buffer-diff-range{,-oid}: Renamed variablesJonas Bernoulli
2026-01-10magit-commit-diff-1: CosmeticsJonas Bernoulli
2026-01-01Improve indentation of interactiveJonas Bernoulli
Emacs 31.1 adds variable `lisp-indent-local-overrides'.
2026-01-01Improve indentation of condJonas Bernoulli
Emacs 31.1 adds variable `lisp-indent-local-overrides'.
2026-01-01Bump copyright yearsJonas Bernoulli
2025-12-15magit-{common-,}post-{commit,merge,rewrite}: New hooksJonas Bernoulli
2025-12-15Collect magit-post-commit-hook and support in one placeJonas Bernoulli
The goal is to (at least semi-) deprecate this eventually, which is why I want it out of the way.
2025-11-16magit-post-refresh-hook: Autoload hook functionsJonas Bernoulli
Closes #5464.
2025-11-05Drop a space from autoload cookiesJonas Bernoulli
The space (if any) between the keyword and form is not stripped when inserting the form into the autoloads file, which looks odd. In Emacs the number of autoload cookies with and without such a space, is almost the same, so that provides no guidance as to what should be preferred. Go with what makes the aligner in me happy.
2025-09-18magit-commit-{absorb,autofixup}: Use prog1Jonas Bernoulli
2025-08-22Use Cond-Let's implementation of and-letJonas Bernoulli
Using the "other elements of VARLIST have access to SYMBOLs from earlier elements" variant is IMHO _wrong_ when there are in fact no other elements.
2025-08-22Use Cond-Let's implementations of {if,when,and,while}-let{,*}Jonas Bernoulli
Cond-Let's `if-let', `if-let*', `when-let', `when-let*' and `and-let*' implementations behave differently from the built-in implementations, but because I have been careful not to depend on the idiosyncrasies, switching over should be mostly safe. Also add shorthands for the other `cond-let--...' macros. We will start using those (and `cond-let' and `cond-let*') in later commits.
2025-07-25Use shorthand match-str instead of match-string-no-propertiesJonas Bernoulli
Almost always would it be better to use `match-string-no-properties' instead of `match-string', but because the name of the former is excruciatingly long for a function that one often wants to use in tight spaces and because it usually "does not really matter", I usually went for the latter. The problem is, it does matter. For example, even strings that are usually only used by code may end up obfuscating debug statements. So let's start doing the right thing, even though there surely will be people frowning at the use of a shorthand. The fake ("match-string" "match-string") shorthand is necessary to protect literal `match-string' and `match-string-no-properties' from being corrupted by interpreted as shorthand for the non-existent `match-stringing' and `match-string-no-propertiesing'. Unfortunately the shorthands have to be specified in each library individually. Using "dir-locals.el" only works if the libraries are compiled. At least this additional noise is neatly tucked away at the end of the files. It might turn out that out of the more than two hundred instances where this replaces `match-string' with `match-string-no-properties' we should have stuck with the former in an instance or two. That's the price of progress and can be fixed once such regressions are reported.
2025-03-01magit-commit: Add magit-rebase-reword-commit but hide it by defaultJonas Bernoulli
This command is also available from the `magit-rebase' menu, and has been for a long time. In the context of `magit-commit' it is the missing "Instant Reword" variant, which one might expect to find here, accompanying "Instant Fixup" and "Instant Squash". Do not make it available by default because it is different from all other commands in this menu, in that it does not create a commit in the presence which is send (whether instantly or later) into the past. In contrast, this command has you immediately hop into a time machine and only once you have arrived at your destiny, can you start messing with the timeline. While this command is unlike its second home neighbors, one can tell that "Rebase to modify/reword/remove a commit" all grew up in the same neighborhood, despite their diverging interests.
2025-02-21Fix various docstringsJonas Bernoulli
2025-02-04magit-commit-amend-assert: Return non-nil if NOPATCH is non-nilJonas Bernoulli
Closes #5306.
2025-02-02Use ## and seq-find instead of --firstJonas Bernoulli
In one case use lambda and in another pcase-lambda, not ##.
2025-01-31magit:--signoff: Set default level via prototypeJonas Bernoulli
2025-01-30Make --signoff available in more menusJonas Bernoulli
But "demote" it a bit, in all menus, by placing it after `--gpg-sign' and putging it on level 6. Closes #5297.
2025-01-20magit-commit-revise: Don't show diff in log-selectJonas Bernoulli
2025-01-17Improve documentation about commit commandsJonas Bernoulli
2025-01-17Rearrange definitions and documentation of commit commandsJonas Bernoulli
Rearrange their definitions and the order in which they are described in the manual, to better mirror their new arrangement in the menu.
2025-01-17magit-commit-squash-internal: Always add either --no-edit or --editJonas Bernoulli
Adding "--edit" is not actually necessary, because the variants that need it, use other arguments, which imply it. But users don't always know which arguments imply which of these two arguments, so it is a nice touch to include this information in the arguments, shown in the process buffer. This also makes it easier to document the behavior of variants; we can now say that some of them use "--edit", without that not actually being true.
2025-01-17magit-commit-{alter,revise}: New commandsJonas Bernoulli
- Bind "A" to `magit-commit-alter'. Previously that was bound to `magit-commit-augment', but the new command is more similar to `magit-commit-amend', whose binding is "a". `amend' and `alter' do the approximately same thing, but the former is limited to the "HEAD" commit. Additionally `alter' needs changes (else use `revise'). - Bind "W" to `magit-commit-revise' because "w" is bound to `magit-commit-reword' and these two are also HEAD/any variants. - Bind "n" to `magit-commit-augment'. The mnemonic being that this adds a "note", which we later have to take into account when writing the final commit message. - Bind "d" to `magit-commit-reshelve' because "n" is now taken. Use "d" because it changes dates. This command is disabled by default. - In the menu, arrange the variants in a way that hopefully makes these relations more obvious. Unfortunately this is not possible without leaving some "table cells" empty.
2025-01-17magit-commit-squash-internal: Change parameter orderJonas Bernoulli
This order better reflects the order in which the respective subtasks happen. Going forward it will also mean that fewer commands have to use nil to skip over an optional parameter. Leave CONFIRMED at the end because it is only used recursively. Also use more descriptive non-nil arguments.
2025-01-17magit-commit-squash-internal: Do not inject = between option and commitJonas Bernoulli
We'll add new variants that would break if we continued to do that. Instead require options to end with "=" if they need that.
2025-01-17magit-commit: Change descriptions of "spread" commandsJonas Bernoulli
2025-01-17magit-commit: Use more columns and add titles to allJonas Bernoulli
2025-01-17magit-commit: Disable magit-commit-reshelveJonas Bernoulli
It's a weird command and I suspect very few people use it. Let's not confuse everybody else. To re-enable this command users have to put it individually on any non-zero level that they have enabled for this menu.
2025-01-17magit-commit: CosmeticsJonas Bernoulli
2025-01-17magit-commit-{absorb,autofixup}: Explicitly set transient behaviorJonas Bernoulli
These commands behave as intended even without doing this, but the binding color in the `magit-commit' menu was still wrong.
2025-01-17magit-commit:--date: Define explicitlyJonas Bernoulli
2025-01-17magit-commit-create: No longer amend with a prefix argumentJonas Bernoulli
Several fine commands dedicated to amending exist, and have been preferable to this prefix argument for many years now.
2025-01-09magit-commit-assert: Call magit-diff-unstaged with magit-diff-argumentsNikita Leshenko
This is similar to how magit-diff-staged is called in this file. Before this change, the final Git command will be called without "--no-ext-diff", which results broken diffs when one has a custom external diff program.
2025-01-05Let the byte-compiler check more function referencesJonas Bernoulli
2025-01-01Bump copyright yearsJonas Bernoulli
2024-12-21magit-commit-absorb: Don't hardcode -v argumentJonas Bernoulli
Previously the argument was hardcoded and the user could additionally enable it explicitly. If they did, that resulted in an error because this command does not support duplicated arguments. Now we default to high verbosity but let the user drop the argument, if they so desire. Closes #5272.
2024-12-21magit-commit-autofixup: Support reducing verbosityJonas Bernoulli
Default to high verbosity but let the user drop the argument.
2024-10-17magit-commit-squash-internal: Reduce nestingJonas Bernoulli
2024-04-15Update contact informationJonas Bernoulli
2024-01-02magit-commit-extend: Fix misplaced newline in docstringJonas Bernoulli