Permalink
Commits on Feb 19, 2017
  1. magit-discard-files--rename: create missing directories

    Discarding a renamed file fails when the directory of the original
    file no longer exists because "git mv <source> <destination>" signals
    an error ("fatal: renaming '<destination>' failed: No such file or
    directory").
    
    When the original file has a leading path (relative to the top-level
    directory), ensure that all the parent directories exist.
    
    Fixes #2998.
    kyleam committed Feb 19, 2017
Commits on Feb 15, 2017
Commits on Feb 14, 2017
  1. Reset Package-Requires for Melpa

    tarsius committed Feb 14, 2017
  2. Release version 2.10.2

    tarsius committed Feb 14, 2017
Commits on Feb 13, 2017
Commits on Feb 12, 2017
  1. Update release notes

    kyleam committed Feb 12, 2017
  2. magit-diff-refresh-buffer: recognize rev^-n range

    Git v2.11 introduced the notation "rev^-n" as a short-hand for
    "rev^n..rev".  Teach magit-diff-refresh-buffer to detect such ranges
    (including "rev^-", where the unspecified n defaults to 1) so that the
    diff buffer header does not falsely report that the diff is between
    "rev^-n" and the working tree.
    kyleam committed Feb 12, 2017
Commits on Feb 10, 2017
  1. Add new function `git-rebase-noop` to add a noop action at point

    If you do a rebase and drop all the commits in the file, git will
    do nothing, because the file is considered empty (everything is
    commented). If you really do want to remove all the commits, you
    have to insert a noop action which prevents the file from being
    empty. It has no other purpose.
    fabacino committed with kyleam Feb 9, 2017
Commits on Feb 9, 2017
  1. Fix handling of async-bytecomp-allowed-packages

    From the doc-string: The value of this variable can also be a list
    with a single element, the symbol `all', in this case packages are
    always compiled asynchronously.
    tarsius committed Feb 9, 2017
Commits on Feb 8, 2017
  1. Record the working tree for separated git directories

    magit-toplevel needs to determine the working tree from inside .git/
    when a buffer is visiting COMMIT_EDITMSG or various other files.  To
    do this, it uses the following logic:
    
     1) file is in .git/modules/<module>/: set working tree to the output
        of "git rev-parse --show-toplevel"
    
     2) file is in .git/worktrees/<wtree>/: set working tree to the path
        in .git/worktrees/<wtree>/gitdir, minus the trailing "/.git"
    
     3) file is in .git: set working tree to the parent directory
    
    This, however, fails when a repository was set up by passing
    --separate-git-dir to "git init" or "git clone", following step 3 to
    return an unrelated parent directory [*].
    
    The most visible consequence of magit-toplevel failing to return the
    working tree for separated gitdirs was that an empty diff buffer was
    displayed while committing (issue #2955).  9e0e2a2 (While committing,
    diff from inside gitdir if necessary, 2017-01-17) worked around this
    by introducing a defvar that could be let-bound to instruct
    magit-toplevel to return the gitdir instead.  This resulted in the
    diff buffer correctly showing staged changes because "git diff
    --cached" works fine from the gitdir, but it broke
    magit-diff-visit-file in these buffers (issue #2981) because the
    default directory was the git directory rather than the top-level of
    the working tree.  This approach also didn't consider other cases
    where magit-toplevel would fail inside a separated gitdir, such as
    running git-rebase-show-commit in a git-rebase-todo buffer.
    
    Instead, let's record the worktree -> gitdir mapping of separated
    repositories before the git call in magit-run-git-with-editor.  When
    magit-toplevel is called from a gitdir file (COMMIT_EDITMSG,
    MERGE_MSG, git-rebase-todo, ...), it can look for a working tree
    associated with the current git directory.  If one isn't found, it can
    take the parent directory as the working tree, as usual.  This comes
    at a price of a magit-toplevel and magit-git-dir call during editing
    commands, but it seems unlikely that any solution could avoid these
    calls.
    
    This should cover all cases where Magit throws users into a buffer
    inside the git directory, making it unlikely that magit-toplevel uses
    an invalid mapping.  A user would have to call a command that involves
    magit-run-git-with-editor and then, before finishing that process, go
    to another working tree that points to the same git directory and
    again call a command that involves magit-run-git-with-editor.  And the
    user would have had to set up these working trees outside of the "git
    worktree" mechanism because magit-toplevel handles "git worktree"
    directories fine.
    
    Fixes #2955.
    Re: #2981.
    
    [*] In Git version 2.8.4 and lower, core.worktree was set when
        --separate-git-dir was used, so "git rev-parse
        --show-toplevel" (step 1) would also work for separated git
        directories.  However, it turns out that Git was not intentionally
        setting core.worktree here:
        https://public-inbox.org/git/87h94d8cwi.fsf@kyleam.com/T/#u
    kyleam committed Feb 6, 2017
  2. magit.org: replace magit-checkout-file with magit-file-checkout

    The former was marked as obsolete in cd5d82f (Rename
    magit-checkout-file to magit-file-checkout, 2016-12-27).
    kyleam committed Feb 8, 2017
Commits on Feb 7, 2017
  1. Update release notes

    kyleam committed Feb 7, 2017
  2. magit-abbrev-length: behave reasonably in an empty repository

    As of d7fcc92 (magit-abbrev-length: handle auto-sized default length,
    2016-12-01), magit-abbrev-length returns 0 when called within an empty
    repository or outside of a repository.
    
    Update magit-abbrev-length to instead return 7 for these edge cases.
    This value is both compatible with the default length prior to Git
    v2.11 and matches the auto-sized default length that Git v2.11
    calculates for a fresh repository.
    
    Whether magit-abbrev-length should return nil or a hard-coded value
    when called outside of a repository is less clear, but returning a
    hard-coded value has the advantage of not requiring additional steps
    to determine whether we're in a repository.  And returning 7 when
    outside of a repository is consistent with the return value of
    magit-abbrev-length before d7fcc92.
    kyleam committed Feb 7, 2017
  3. Only load pcase at compile time

    See comment on d3eeadd.
    tarsius committed Feb 7, 2017
  4. Explicitly load pcase for Emacs v24.4

    Fixes #2987.
    tarsius committed Feb 7, 2017
Commits on Feb 6, 2017
  1. Declare x-stretch-cursor to avoid compiler warning

    This variable is not defined when Emacs was compiled without graphics
    support.  Setting it anyway does no harm, so we just shut up the byte
    compiler instead of avoiding to set it at all.
    
    Fixes http://emacs.stackexchange.com/questions/30369.
    tarsius committed Feb 6, 2017
Commits on Feb 5, 2017
  1. Revert "While committing, diff from inside gitdir if necessary"

    This reverts commit 9e0e2a2.
    
    Fixes #2981, but reopens #2955.
    kyleam committed Feb 5, 2017
Commits on Feb 4, 2017
  1. Abbreviate default directory for buffer listings

    Fixes #2974
    holomorph committed Feb 4, 2017
Commits on Feb 1, 2017
  1. Fix two bugs that prevented cherry-picking with --mainline

    magit-cherry-pick-popup: Make "--mainline" be an option (not a switch).
    Also fix typo: "Reply" should be "Replay".
    
    magit-cherry-pick, magit-cherry-apply: Do not 'assert one parent' if the
    --mainline option is present.
    bennorth committed with tarsius Jan 31, 2017
Commits on Jan 31, 2017
Commits on Jan 28, 2017
  1. Reset Package-Requires for Melpa

    tarsius committed Jan 28, 2017
  2. Release version 2.10.1

    tarsius committed Jan 28, 2017
  3. Update release notes

    tarsius committed Jan 28, 2017
Commits on Jan 20, 2017
  1. Fixup release notes

    tarsius committed Jan 20, 2017
Commits on Jan 19, 2017
  1. magit-diff-show-or-scroll: also check hash when deciding what to do

    When the revision or stash buffer already showed the requested
    reference, but that reference no longer pointed at the same revision,
    then the buffer was scrolled instead of updated.  Now we save the
    revision hash and compare that too.
    
    Fixes #2966.
    tarsius committed Jan 19, 2017