Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Oct 10, 2015
  1. @tarsius

    assert that remote git can be found and is recent enough

    tarsius authored
    In `magit-status-internal' call the new `magit-tramp-assert' to make
    sure that when it shows the status of a remote repository using Tramp
    git can be found on the host and that it is recent enough.
    For local repositories `magit-tramp-assert' bails quickly and is not
    very expensive.  Once `magit-tramp-assert' has found a good git for a
    given host, then it caches that information.
    The assert is only performed in `magit-status-internal' because it
    (`magit-status' actually) it the main entry point.
  2. @tarsius
  3. @tarsius
  4. @tarsius
  5. @tarsius
  6. @tarsius
  7. @tarsius
  8. @tarsius

    use remap bindings in section keymaps

    tarsius authored
    Bind [remap magit-visit-thing] instead of "\r" and
    bind [remap magit-delete-thing] instead of "k" in
    all section keymaps that previously used the latter.
    This allows binding other keys to these commands in `magit-mode-map'
    and having that take affect in the section keymaps without having to
    also change any bindings in these keymaps.
  9. @tarsius
Commits on Oct 9, 2015
  1. @tarsius
  2. @tarsius
  3. @warner @tarsius
  4. @tarsius

    add new magit-maybe-show-margin to magit-mode-setup-hook

    tarsius authored
    It's intentional that `magit-log-show-margin' is
    not respected in `magit-reflog-mode' buffers.
  5. @tarsius

    run magit-mode-setup-hook after displaying the buffer

    tarsius authored
    In [1: 9eb318b] the order of of events in `magit-mode-setup' was
    changed from
      1. display buffer
      2. run setup hook
      3. turn on mode
      4. refresh buffer
      2. run setup hook
      3. turn on mode
      1. display buffer
      4. refresh buffer
    because `magit-display-buffer's behavior now depends on the major-mode.
    I considered removing `magit-mode-setup-hook' completely because given
    the above order of events it is not necessary, one could just use
    `magit-mode-hook' or a more specific `magit-{*}-mode-hook'.
    But it turns out we actually need a hook that runs after displaying the
    buffer (see next commit).  So change the order to
      3. turn on mode
      1. display buffer
      2. run setup hook
      4. refresh buffer
    By the way, it would be preferable if we could use this order
      3. turn on mode
      1. display buffer
      4. refresh buffer
      2. run setup hook
    but that is currently not possible because some section inserters only
    work properly if the buffer the insert into, is being displayed in a
    window.  Also note that `magit-display-buffer' has to run outside any
    `with-current-buffer' or `safe-current-buffer' forms.
    Also define `magit-mode-setup-hook' as an option instead of as an
    undocumented variable.
    1: 9eb318b
       concentrate display-buffer logic in one place
  6. @tarsius
  7. @tarsius

    magit-process-sentinel: refresh even if buffer is no longer alive

    tarsius authored
    Call `magit-refresh' even if the buffer that was current when the buffer
    was started is no longer alive.  This ensures that the status buffer is
  8. @tarsius

    magit-refresh: refresh status buffer regardless of current buffer

    tarsius authored
    Refresh the status buffer even if the major-mode of the current buffer
    does not derive from `magit-mode'.
  9. @tarsius
Commits on Oct 8, 2015
  1. @tarsius
  2. @tarsius
  3. @tarsius
  4. @tarsius
  5. @tarsius
  6. @tarsius

    uniquify names of magit buffers by default

    tarsius authored
    Add new option `magit-uniquify-buffer-names' with a default value of t.
    Due to how `uniquify.el' is implemented, buffer name cannot be made
    unique before they have been created, so part of this has to be
    implemented in `magit-generate-new-buffer'.
    Modes are added to `uniquify-list-buffers-directory-modes' on demand
    instead of upfront, because this way derived modes implemented in
    third-party extensions are automatically taken care of.
  7. @tarsius

    find existing magit buffers by mode instead of by name

    tarsius authored
    Also remove the command `magit-rename-buffer', because renaming a buffer
    no longer prevents it from being reused to display different values.  A
    different mechanism to lock a buffer to a value will be added in a later
  8. @tarsius

    magit-generate-buffer-name-function: new option

    tarsius authored
    Add new option `magit-generate-buffer-name-function' and new function
    `magit-generate-buffer-name-default-function' as its default value.
    Also add new function `magit-generate-new-buffer' as a wrapper around
    the calls to `magit-generate-buffer-name-function' and
  9. @tarsius

    remove redundant code which sanitizes directory paths

    tarsius authored
    In `magit-mode-get-buffer' and `magit-status-internal' remove redundant
    code which sanitizes directory paths.  We don't have to do this here
    because all we do with these paths is to feed them to `magit-toplevel',
    which already takes care of expanding the directory as necessary.
  10. @tarsius
  11. @tarsius

    magit-mode-get-buffer-create: remove function

    tarsius authored
    It was no longer used more than once, and that one caller can
    just use `magit-mode-get-buffer' directly with a non-nil value
    for the CREATE argument.
  12. @tarsius

    magit-process-buffer: don't use magit-mode-get-buffer-create

    tarsius authored
    We already did not use `magit-mode-setup' in order to avoid unnecessary
    work every time a process is run for side-effects and because that would
    run `magit-mode-hook' which by default results in git being run, which
    could have lead to an error (see below).
    Now `magit-process-buffer' also finds or else creates the buffer itself,
    instead of using `magit-mode-get-buffer-create' for that purpose.
    If `default-directory' isn't inside a repository, then it walks up the
    directory until it finds "the" root directory (usually "/", but when
    using Tramp or MS Windows, then something else), and finds or creates
    the buffer for that directory.  Even if the root directory isn't also
    the toplevel of a repository (which it seldom is) it is never-the-less
    used in the buffer name, e.g. *magit-process: /*, and as the
    `default-directory' of that buffer.
    Previously when this function was called for the first time with a
    `default-directory' that isn't located inside a repository, then a
    buffer *magit-process: -* was create and the `default-directory' which
    was current when this function was called was used as the buffer-local
    value.  That value was never changed, which was a problem if that
    directory was ever deleted (e.g. the `magit-mode-hook' issue mentioned
  13. @tarsius

    take full advantage of magit-display-buffer-noselect

    tarsius authored
    Remove the NOSELECT argument of `magit-show-commit' and
    `magit-show-stash', and stop let-binding `magit-display-buffer-noselect'
    inside these commands.
    Instead let-bind `magit-display-buffer-no-select' directly in their
    callers `magit-diff-show-or-scroll', `magit-log-maybe-show-commit',
    and `magit-blame-update-other-window'.
  14. @tarsius

    concentrate display-buffer logic in one place

    tarsius authored
    Use low-level `display-buffer' instead of high-level buffer switching
    functions.  In combination with other changes described below, this
    gives users complete control over how buffers are to be displayed,
    without having to fight against hard-coded defaults.
    Instead of hard-coding the rules that govern how windows are selected to
    display certain buffers, define them in one place.  The existing rules
    are collected in the new function `magit-display-buffer-traditional'.
    That function is the default value of the new option
    `magit-display-buffer-function', which specifies the function used by
    `magit-display-buffer' to actually display the buffer.
    All Magit buffers are displayed using `magit-display-buffer', which is
    called by `magit-mode-setup' and `magit-process-buffer'.  Together these
    two functions are responsible for the creation of each and every Magit
    buffer.  `magit-display-buffer' should never called directly by anything
    else. (Popup buffers are not Magit buffers, their major-mode does not
    derived from `magit-mode'.)
    Unlike `display-buffer', `magit-display-buffer' also selects the window,
    unless the new variable `magit-display-buffer-noselect' is let-bound to
    a non-nil value.  This variable is only intended for special cases.
    Two options, and therefore quick ways of customizing the behavior, fall
    victim to this change: `magit-status-buffer-switch-function' and
    `magit-diff-switch-buffer-function'.  We cannot preserve these options
    and use them in `magit-display-buffer-traditional' because they were
    used to specify arbitrary high-level buffer switching functions, which
    we cannot simply map to low-level display actions.
  15. @tarsius

    magit-{pre,post}-display-buffer-hook: new variables

    tarsius authored
    Also rename `magit-mode-display-buffer' to `magit-display-buffer'.
  16. @tarsius
  17. @tarsius

    magit-mode-hook: add magit-xref-setup

    tarsius authored
    Instead of hard-coding that in `magit-mode-setup'.
Something went wrong with that request. Please try again.