1. 07 5月, 2019 3 次提交
    • N
      doc: promote "git restore" · 80f537f7
      Nguyễn Thái Ngọc Duy 提交于
      The new command "git restore" (together with "git switch") are added
      to avoid the confusion of one-command-do-all "git checkout" for new
      users. They are also helpful to avoid ambiguous context.
      
      For these reasons, promote it everywhere possible. This includes
      documentation, suggestions/advice from other commands.
      
      One nice thing about git-restore is the ability to restore
      "everything", so it can be used in "git status" advice instead of both
      "git checkout" and "git reset".  The three commands suggested by "git
      status" are add, rm and restore.
      
      "git checkout" is also removed from "git help" (i.e. it's no longer
      considered a commonly used command)
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80f537f7
    • N
      user-manual.txt: prefer 'merge --abort' over 'reset --hard' · fc991b43
      Nguyễn Thái Ngọc Duy 提交于
      Since the operation in progress is merge, stick to the 'git merge'
      variant of aborting. 'git reset --hard' does not really tell you about
      aborting the merge by just looking, longer to type, and even though I
      know by heart what --hard do, I still dislike it when I need to consider
      whether --hard, --mixed or --soft.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fc991b43
    • N
      checkout: split part of it to new command 'restore' · 46e91b66
      Nguyễn Thái Ngọc Duy 提交于
      Previously the switching branch business of 'git checkout' becomes a
      new command 'switch'. This adds the restore command for the checking
      out paths path.
      
      Similar to git-switch, a new man page is added to describe what the
      command will become. The implementation will be updated shortly to
      match the man page.
      
      A couple main differences from 'git checkout <paths>':
      
      - 'restore' by default will only update worktree. This matters more
        when --source is specified ('checkout <tree> <paths>' updates both
        worktree and index).
      
      - 'restore --staged' can be used to restore the index. This command
        overlaps with 'git reset <paths>'.
      
      - both worktree and index could also be restored at the same time
        (from a tree) when both --staged and --worktree are specified. This
        overlaps with 'git checkout <tree> <paths>'
      
      - default source for restoring worktree and index is the index and
        HEAD respectively. A different (tree) source could be specified as
        with --source (*).
      
      - when both index and worktree are restored, --source must be
        specified since the default source for these two individual targets
        are different (**)
      
      - --no-overlay is enabled by default, if an entry is missing in the
        source, restoring means deleting the entry
      
      (*) I originally went with --from instead of --source. I still think
        --from is a better name. The short option -f however is already
        taken by force. And I do think short option is good to have, e.g. to
        write -s@ or -s@^ instead of --source=HEAD.
      
      (**) If you sit down and think about it, moving worktree's source from
        the index to HEAD makes sense, but nobody is really thinking it
        through when they type the commands.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      46e91b66
  2. 02 4月, 2019 8 次提交
  3. 11 3月, 2019 1 次提交
  4. 07 3月, 2019 2 次提交
  5. 03 3月, 2019 1 次提交
  6. 01 3月, 2019 1 次提交
  7. 24 2月, 2019 1 次提交
  8. 23 2月, 2019 1 次提交
  9. 22 2月, 2019 6 次提交
  10. 16 2月, 2019 1 次提交
  11. 15 2月, 2019 2 次提交
  12. 14 2月, 2019 1 次提交
  13. 13 2月, 2019 2 次提交
  14. 09 2月, 2019 1 次提交
  15. 08 2月, 2019 2 次提交
    • E
      log,diff-tree: add --combined-all-paths option · d76ce4f7
      Elijah Newren 提交于
      The combined diff format for merges will only list one filename, even if
      rename or copy detection is active.  For example, with raw format one
      might see:
      
        ::100644 100644 100644 fabadb8 cc95eb0 4866510 MM	describe.c
        ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM	bar.sh
        ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR	phooey.c
      
      This doesn't let us know what the original name of bar.sh was in the
      first parent, and doesn't let us know what either of the original names
      of phooey.c were in either of the parents.  In contrast, for non-merge
      commits, raw format does provide original filenames (and a rename score
      to boot).  In order to also provide original filenames for merge
      commits, add a --combined-all-paths option (which must be used with
      either -c or --cc, and is likely only useful with rename or copy
      detection active) so that we can print tab-separated filenames when
      renames are involved.  This transforms the above output to:
      
        ::100644 100644 100644 fabadb8 cc95eb0 4866510 MM	desc.c	desc.c	desc.c
        ::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM	foo.sh	bar.sh	bar.sh
        ::100644 100644 100644 e07d6c5 9042e82 ee91881 RR	fooey.c	fuey.c	phooey.c
      
      Further, in patch format, this changes the from/to headers so that
      instead of just having one "from" header, we get one for each parent.
      For example, instead of having
      
        --- a/phooey.c
        +++ b/phooey.c
      
      we would see
      
        --- a/fooey.c
        --- a/fuey.c
        +++ b/phooey.c
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d76ce4f7
    • K
      doc: prevent overflowing <code> tag in rendered HTML · 5427de96
      Katrin Leinweber 提交于
      Add an apparently missing back-tick to fix a multi-line <code> section
      on https://git-scm.com/docs/git-log which seems to have been caused by
      commit 18fb7ffc ("pretty: respect color settings [...]", 2017-07-13).
      Signed-off-by: NKatrin Leinweber <katrin.leinweber@uni-konstanz.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5427de96
  16. 07 2月, 2019 2 次提交
  17. 06 2月, 2019 1 次提交
  18. 05 2月, 2019 4 次提交
    • T
      revert "checkout: introduce checkout.overlayMode config" · e92aa0e4
      Thomas Gummerer 提交于
      This reverts 1495ff7d ("checkout: introduce checkout.overlayMode
      config", 2019-01-08) and thus removes the checkout.overlayMode config
      option.
      
      The option was originally introduced to give users the option to make
      the new no-overlay behaviour the default.  However users may be using
      'git checkout' in scripts, even though it is porcelain.  Users setting
      the option to false may actually end up accidentally breaking scripts.
      
      With the introduction of a new subcommand that will make the behaviour
      the default, the config option will not be needed anymore anyway.
      Revert the commit and remove the config option, so we don't risk
      breaking scripts.
      Suggested-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NThomas Gummerer <t.gummerer@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e92aa0e4
    • M
      doc-diff: don't `cd_to_toplevel` · 2afe9278
      Martin Ågren 提交于
      `usage` tries to call $0, which might very well be "./doc-diff", so if
      we `cd_to_toplevel` before calling `usage`, we'll end with an error to
      the effect of "./doc-diff: not found" rather than a friendly `doc-diff
      -h` output. This regressed in ad517430 ("doc-diff: add --clean mode to
      remove temporary working gunk", 2018-08-31) where we moved the call to
      `cd_to_toplevel` to much earlier.
      
      A general fix might be to teach git-sh-setup to save away the absolute
      path for $0 and then use that, instead. I'm not aware of any portable
      way of doing that, see, e.g., d2addc3b ("t7800: readlink may not be
      available", 2016-05-31).
      
      An early version of this patch moved `cd_to_toplevel` back to where it
      was before ad517430 and taught the "--clean" code to cd on its own.
      But let's try instead to get rid of the cd-ing entirely. We don't really
      need it and we can work with absolute paths instead. There's just one
      use of $PWD that we need to adjust by simply dropping it.
      Suggested-by: NJeff King <peff@peff.net>
      Signed-off-by: NMartin Ågren <martin.agren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2afe9278
    • Æ
      diff-tree doc: correct & remove wrong documentation · 9fce19a4
      Ævar Arnfjörð Bjarmason 提交于
      The documentation saying that diff-tree didn't support anything except
      literal prefixes hasn't been true since
      d38f2809 ("tree_entry_interesting(): support wildcard matching",
      2010-12-15), but this documentation was not updated at the time.
      
      Since this command uses pathspecs like most other commands, there's no
      need to show examples of how the various "cmd <revs> <paths>"
      invocations work.
      
      Furthermore, the "git diff-tree --abbrev 5319e4" example shown here
      never worked. We'd ended up with that through a combination of
      62b42d34 ("docs: fix some antique example output", 2011-05-26) and
      ac4e0869 ("Adjust core-git documentation to more recent Linus GIT.",
      2005-05-05), but "git diff-tree <tree>" was always invalid.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9fce19a4
    • W
      config: allow giving separate author and committer idents · 39ab4d09
      William Hubbs 提交于
      The author.email, author.name, committer.email and committer.name
      settings are analogous to the GIT_AUTHOR_* and GIT_COMMITTER_*
      environment variables, but for the git config system. This allows them
      to be set separately for each repository.
      
      Git supports setting different authorship and committer
      information with environment variables. However, environment variables
      are set in the shell, so if different authorship and committer
      information is needed for different repositories an external tool is
      required.
      
      This adds support to git config for author.email, author.name,
      committer.email and committer.name  settings so this information
      can be set per repository.
      
      Also, it generalizes the fmt_ident function so it can handle author vs
      committer identification.
      Signed-off-by: NWilliam Hubbs <williamh@gentoo.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      39ab4d09