1. 04 Nov, 2017 1 commit
  2. 03 Nov, 2017 2 commits
  3. 02 Nov, 2017 1 commit
    • Jonas Bernoulli's avatar
      Support one-section magit-selections · 115041d4
      Jonas Bernoulli authored
      For a long time Magit supported selecting two or more sibling sections
      using the region and then acting on that selection instead of only on
      the current section.  Single-section selections were not supported and
      a region that did not span multiple siblings was not visualized as a
      selection, instead the underlying region was visualized as it is in
      non-magit buffers.
      
      The change users will notice first is that when they press C-SPC to
      set the beginning of the region/magit-selection on a section heading,
      then the magit-selection is visualized.  Previously not even the
      region was shown after just pressing C-SPC, because the mark and the
      point were identical, so there was no non-empty region to visualize.
      
      For the time being most commands continue to behave exactly as before
      when there is a one-section selection: the act on the current section
      instead.  While a one-section selection is a selection that contains
      nothing but the current section, this difference between the current
      section and a set consisting of only the current section is still
      relevant.  It affects whether and how commands ask for confirmation
      and/or offer the user to act on something else instead.
      
      The reason I decided against supporting one-section selections in the
      past is that it is a bit unfortunate to visualize the selection and
      then the invoked command does not actually use it.  But this is no
      different from a multi-section selection being visualized and then
      invoking a command that isn't magit-selection aware at all.  Or from
      having the region visualized in any Emacs buffer and then invoking any
      command that doesn't behave differently when the region is active.
      
      Beginning with this commit only a handful of commands begin using a
      one-section selection.  Most importantly, and this is what motivated
      this change, it is now possible to use `magit-branch-spinoff' after
      selecting just HEAD to create a new branch rewinding the previously
      current branch by a single commit.  Previously it was only possible
      to rewind it to its upstream or to rewind it by at least two commits.
      
      The other commands that respect one-section selections are:
      - magit-am-apply-patches
      - magit-cherry-apply
      - magit-cherry-pick
      - magit-revert
      - magit-revert-no-commit
      - magit-stash-drop
      - magit-tag-delete
      
      The recently added commands `magit-previous-line' and
      `magit-next-line' now forgo moving on the first shift-selection move
      when point is on a section heading, not just when inside a hunk body.
      
      Closes #2920.
      Closes #3026.
      115041d4
  4. 17 Jun, 2017 1 commit
  5. 28 May, 2017 2 commits
    • Kyle Meyer's avatar
      magit-modified-files: rename to magit-unstaged-files · e55874f0
      Kyle Meyer authored
      Mark magit-modified-files as obsolete and rename it to
      magit-unstaged-files [*] because the new name 1) aligns nicely with
      the name magit-staged-files and 2) makes it clearer that the returned
      list is restricted to files with unstaged changes.
      
      [*] Unlike the just-deleted magit-unstaged-files, magit-modified-files
          does not include files that only have staged changes.
      e55874f0
    • Kyle Meyer's avatar
      Touch up a couple of doc-string typos · 31fe51a4
      Kyle Meyer authored
      31fe51a4
  6. 25 Apr, 2017 1 commit
  7. 08 Apr, 2017 1 commit
    • Kyle Meyer's avatar
      magit-stage-untracked: handle remote-less repos · 666f6038
      Kyle Meyer authored
      If a subdirectory contains a repo that doesn't point to a remote (e.g,
      a subdirectory where 'git init' was called), we pass a nil for the URL
      to magit-submodule-add.  nil's are filtered out, so PATH is then taken
      as the url argument by 'git submodule add', leading to a git error:
      
        repo URL: '.subdir/' must be absolute or begin with ./|../
      
      Adding a submodule with a URL that points directly to a subdirectory
      is probably uncommon, but Git does consider it valid.  Support this
      setup by replacing a nil URL with "./<repo>".
      
      Fixes #3047.
      666f6038
  8. 19 Feb, 2017 1 commit
    • Kyle Meyer's avatar
      magit-discard-files--rename: create missing directories · 35566abd
      Kyle Meyer authored
      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.
      35566abd
  9. 04 Jan, 2017 1 commit
  10. 29 Dec, 2016 1 commit
  11. 27 Dec, 2016 1 commit
  12. 22 Dec, 2016 2 commits
  13. 13 Jul, 2016 1 commit
  14. 09 Jun, 2016 1 commit
  15. 11 May, 2016 2 commits
    • Jonas Bernoulli's avatar
      use --reject to apply at least non-conflicting hunks · e9fef5eb
      Jonas Bernoulli authored
      When applying changes to files in the working tree results in conflicts,
      then `git apply' aborts and does not apply anything.  What we would like
      it to do, is to perform a 3-way merge, just like when applying changes
      to the index, but unfortunately that is not possible.
      
      When reversing changes and when discarding staged changes while there
      are unstaged changes, then use `--reject'.  This won't insert conflict
      markers into files in the working tree, but it ensures that changes that
      can be applied are applied even when there are other changes that cannot.
      
      For changes that could not be applied `--reject' causes the creation of
      diff files which contain those changes.  We would have liked for Git to
      create conflict markers - using such "conflict files" is the closest we
      can get to that.
      e9fef5eb
    • Jonas Bernoulli's avatar
      better document use of --3way argument · 6c2b541c
      Jonas Bernoulli authored
      6c2b541c
  16. 07 May, 2016 2 commits
  17. 03 Apr, 2016 1 commit
  18. 29 Mar, 2016 1 commit
  19. 13 Mar, 2016 2 commits
  20. 02 Mar, 2016 2 commits
  21. 27 Feb, 2016 1 commit
  22. 27 Jan, 2016 1 commit
  23. 26 Jan, 2016 1 commit
    • Jonas Bernoulli's avatar
      magit-unstage: reverse committed changes · 938c052e
      Jonas Bernoulli authored
      Add new command `magit-reverse-in-index' but do not bind any key to it.
      Instead make `magit-unstage' call it when the user attempts to unstage
      a committed change.  Setting the new option `magit-unstage-committed'
      to `nil' disables this behavior.
      938c052e
  24. 12 Jan, 2016 1 commit
    • Jonas Bernoulli's avatar
      revert buffers using a globalized variant of auto-revert-mode · f916cd03
      Jonas Bernoulli authored
      Replace the old magit-specific auto-revert implementation with the
      mode `magit-auto-revert-mode', a globalized variant of the built-in
      `auto-revert-mode'.  By default Magit still explicitly triggers the
      reverts after running git for side-effects.  Automatic reverts are
      still enabled by default, and Magit is less verbose about it.  The
      behavior can be tuned using `magit-auto-revert-' and `auto-revert-'
      options.
      
      The main benefit of this change is that this implementation caches
      whether a file is tracked or not.  The old implementation determined
      this on every revert cycle, which did not perform well when there
      were many open buffers and/or many tracked files.
      f916cd03
  25. 10 Jan, 2016 1 commit
  26. 01 Jan, 2016 1 commit
  27. 08 Dec, 2015 1 commit
  28. 11 Nov, 2015 1 commit
  29. 11 Oct, 2015 1 commit
  30. 03 Oct, 2015 1 commit
  31. 02 Oct, 2015 3 commits