| Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Closes #5306.
|
|
In one case use lambda and in another pcase-lambda, not ##.
|
|
|
|
But "demote" it a bit, in all menus, by placing it after `--gpg-sign'
and putging it on level 6.
Closes #5297.
|
|
|
|
|
|
Rearrange their definitions and the order in which they are described
in the manual, to better mirror their new arrangement in the menu.
|
|
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.
|
|
- 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.
|
|
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.
|
|
We'll add new variants that would break if we continued to do that.
Instead require options to end with "=" if they need that.
|
|
|
|
|
|
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.
|
|
|
|
These commands behave as intended even without doing this, but
the binding color in the `magit-commit' menu was still wrong.
|
|
|
|
Several fine commands dedicated to amending exist, and have
been preferable to this prefix argument for many years now.
|
|
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.
|
|
|
|
|
|
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.
|
|
Default to high verbosity but let the user drop the argument.
|
|
|
|
|
|
|
|
|
|
Signal an error if there are any unmerged changes.
Instead of unconditionally signaling an error when there are
unstaged changes, ask the user whether they want to proceed.
Closes #4985.
|
|
In a few cases use `when-let*' or `and-let*' instead.
I haven't done a full 180 on anaphoric conditionals; if a builtin
equivalent existed, I would use that in some instances.
However, having looked at all the existing uses of `when-let', it
turns out there are way fewer such cases than I had anticipated.
|
|
Of course this is not an exact substitute — none exits — but
that doesn't matter here because we know the list contains at most
one matching element and the list is short enough for the needless
work to be insignificant.
|
|
|
|
For printf compatibility, %i is equivalent[1] to %d -- but only %d
is documented.
The simple %i cases are being passed directly to `format', or
indirectly via `magit-confirm'. The %%i cases are being processed
by either (format (format ...)) or (magit-confirm (format ...)).
[1] See styled_format() in src/editfns.c, which consistently tests
conversion == 'd' || conversion == 'i'.
|
|
Closes #4900.
|
|
Five years ago in [1: 5f407a29ac] we took the first step toward this.
1: 2018-10-15 5f407a29ac63b338c3c75e30b4633b44d5745036
magit-gitdir: New function
Previously we cached the wrong thing. `expand-file-name' is cheap but
"git rev-parse --git-dir" is not. Because `magit-git-dir' is where we
cached, rev-parse was still needlessly called multiple times with the
same arguments during a refresh. The effect should be most noticeable
during a rebase.
|
|
|
|
|
|
Commands that depend on optional third-party Git extensions use
executable-find to check whether the extension is available. That
misses the legitimate case where an extension is installed in Git's
exec path rather than a directory in $PATH.
Update these spots to call a new helper that looks in Git's exec path
before calling executable-find. Note that the order is chosen to
follow Git's precedence (though that doesn't matter for any of the
current callers because they don't use the return value).
Closes #4812.
|
|
When magit-commit-show-diff is non-nil, the diff window is typically
deleted by with-editor-return restoring the initial window
configuration, but it isn't deleted by commands that go through
magit-commit-squash-internal. In the case of
magit-commit{,-instant}-{fixup,squash}, this is because the editor
isn't invoked. For magit-commit-augment, the editor is invoked, but
the diff is already displayed by the time with-editor stores the
initial window configuration.
Teach magit-commit-squash-internal to restore the window configuration
so that these commands behave the same as other commit commands.
Closes #4767.
|
|
|
|
Technically (t) and t are equally valid non-nil values for the
`inhibit-same-window' display buffer action alist entry, but to
minimize confusion and proliferation of future mistakes, use the
simpler and more widespread boolean.
|
|
As of 2dfeaa68 (magit-commit-diff-1: Use different heuristics,
2022-06-07), magit-commit-diff-1 uses magit-anything-unstaged-p when
deciding what diff to show. However, $GIT_DIR is the default
directory when magit-commit-diff-1 is called, so the 'git diff'
command used by magit-anything-unstaged-p fails with an exit code of
128, leading to magit-anything-unstaged-p returning nil even when
there are unstaged changes.
Switch to the top-level of the working tree so that
magit-anything-unstaged-p gives an accurate answer.
Closes #4725.
|
|
Most importantly, do not show an alternative diff unless we are
confident that doing so is useful, or at least not highly confusing.
No longer derive the alternative diff from the arguments used for the
initial diff. Ignore the last rebase command, because very often that
has nothing to do with the commit that is being created.
Closes #3246.
|
|
|
|
The logic is the same as before but instead of determining the
appropriate diff command and calling that, we determine the
appropriate diff arguments and then call `magit-diff-setup-buffer'
directly instead of the respective command.
|
|
|