1. 06 12月, 2013 1 次提交
    • J
      commit -v: strip diffs and submodule shortlogs from the commit message · 1a72cfd7
      Jens Lehmann 提交于
      When using the '-v' option of "git commit" the diff added to the commit
      message temporarily for editing is stripped off after the user exited the
      editor by searching for "\ndiff --git " and truncating the commmit message
      there if it is found.
      
      But this approach has two problems:
      
      - when the commit message itself contains a line starting with
        "diff --git" it will be truncated there prematurely; and
      
      - when the "diff.submodule" setting is set to "log", the diff may
        start with "Submodule <hash1>..<hash2>", which will be left in
        the commit message while it shouldn't.
      
      Fix that by introducing a special scissor separator line starting with the
      comment character ('#' or the core.commentChar config if set) followed by
      two lines describing what it is for. The scissor line - which will not be
      translated - is used to reliably detect the start of the diff so it can be
      chopped off from the commit message, no matter what the user enters there.
      
      Turn a known test failure fixed by this change into a successful test;
      also add one for a diff starting with a submodule log and another one for
      proper handling of the comment char.
      Reported-by: NAri Pollak <ari@debian.org>
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1a72cfd7
  2. 12 10月, 2013 1 次提交
  3. 13 9月, 2013 1 次提交
  4. 07 9月, 2013 1 次提交
    • M
      status: disable display of '#' comment prefix by default · 2556b996
      Matthieu Moy 提交于
      Historically, "git status" needed to prefix each output line with '#' so
      that the output could be added as comment to the commit message. This
      prefix comment has no real purpose when "git status" is ran from the
      command-line, and this may distract users from the real content.
      
      Disable this prefix comment by default, and make it re-activable for
      users needing backward compatibility with status.displayCommentPrefix.
      
      Obviously, "git commit" ignores status.displayCommentPrefix and keeps the
      comment unconditionnaly when writing to COMMIT_EDITMSG (but not when
      writing to stdout for an error message or with --dry-run).
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2556b996
  5. 16 7月, 2013 1 次提交
  6. 10 7月, 2013 1 次提交
  7. 03 4月, 2013 2 次提交
  8. 17 3月, 2013 4 次提交
  9. 06 2月, 2013 1 次提交
  10. 16 9月, 2012 1 次提交
  11. 17 7月, 2012 1 次提交
    • J
      status: color in-progress message like other header messages · 3cd9d1b2
      Jeff King 提交于
      The "status" command recently learned to describe the
      in-progress operation in its long output format (e.g.,
      rebasing, am, etc). This message gets its own slot in the
      color table, even though it is not configurable. As a
      result, if the user has set color.status.header to a
      non-default value, this message will not match (and cannot
      be made to match, as there is no config option).
      
      It is probably more sane to just color it like the rest of
      the text (i.e., just use color.status.header). This would
      not allow users to customize the color of this message
      independently, but they cannot do that with the current code
      anyway, and if somebody wants to build customizable
      colorization later, this patch does not make it much harder
      to do so.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3cd9d1b2
  12. 15 6月, 2012 1 次提交
  13. 08 5月, 2012 3 次提交
    • J
      status: refactor colopts handling · 4d2292e9
      Jeff King 提交于
      The current code reads the config and command-line options
      into a separate "colopts" variable, and then copies the
      contents of that variable into the "struct wt_status". We
      can eliminate the extra variable and copy just write
      straight into the wt_status struct.
      
      This simplifies the "status" code a little bit.
      Unfortunately, it makes the "commit" code one line more
      complex; a side effect of the separate variable was that
      "commit" did not copy the colopts variable, so any
      column.status configuration had no effect.
      
      The result still ends up cleaner, though. In the previous
      version, it was unclear whether commit simply forgot to copy
      the colopt variable, or whether it was intentional. Now it
      explicitly turns off column options. Furthermore, if commit
      later learns to respect column.status, this will make the
      end result simpler. I punted on just adding that feature
      now, because it was sufficiently non-obvious that it should
      not go into a refactoring patch.
      Signed-off-by: NJeff King <peff@peff.net>
      4d2292e9
    • J
      status: respect "-b" for porcelain format · d4a6bf1f
      Jeff King 提交于
      There is no reason not to, as the user has to explicitly ask
      for it, so we are not breaking compatibility by doing so. We
      can do this simply by moving the "show_branch" flag into
      the wt_status struct. As a bonus, this saves us from passing
      it explicitly, simplifying the code.
      Signed-off-by: NJeff King <peff@peff.net>
      d4a6bf1f
    • J
      status: refactor null_termination option · 3207a3a2
      Jeff King 提交于
      This option is passed separately to the wt_status printing
      functions, whereas every other formatting option is
      contained in the wt_status struct itself. Let's do the same
      here, so we can avoid passing it around through the call
      stack.
      Signed-off-by: NJeff King <peff@peff.net>
      3207a3a2
  14. 28 4月, 2012 1 次提交
  15. 09 3月, 2011 2 次提交
  16. 22 2月, 2011 1 次提交
    • J
      Teach commit about CHERRY_PICK_HEAD · 37f7a857
      Jay Soffian 提交于
      Previously the user was advised to use commit -c CHERRY_PICK_HEAD after
      a conflicting cherry-pick. While this would preserve the original
      commit's authorship, it would sadly discard cherry-pick's carefully
      crafted MERGE_MSG (which contains the list of conflicts as well as the
      original commit-id in the case of cherry-pick -x).
      
      On the other hand, if a bare 'commit' were performed, it would preserve
      the MERGE_MSG while resetting the authorship.
      
      In other words, there was no way to simultaneously take the authorship
      from CHERRY_PICK_HEAD and the commit message from MERGE_MSG.
      
      This change fixes that situation. A bare 'commit' will now take the
      authorship from CHERRY_PICK_HEAD and the commit message from MERGE_MSG.
      If the user wishes to reset authorship, that must now be done explicitly
      via --reset-author.
      
      A side-benefit of passing commit authorship along this way is that we
      can eliminate redundant authorship parsing code from revert.c.
      
      (Also removed an unused include from revert.c)
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      37f7a857
  17. 30 11月, 2010 1 次提交
  18. 26 6月, 2010 1 次提交
    • J
      Add the option "--ignore-submodules" to "git status" · 46a958b3
      Jens Lehmann 提交于
      In some use cases it is not desirable that "git status" considers
      submodules that only contain untracked content as dirty. This may happen
      e.g. when the submodule is not under the developers control and not all
      build generated files have been added to .gitignore by the upstream
      developers. Using the "untracked" parameter for the "--ignore-submodules"
      option disables checking for untracked content and lets git diff report
      them as changed only when they have new commits or modified content.
      
      Sometimes it is not wanted to have submodules show up as changed when they
      just contain changes to their work tree (this was the behavior before
      1.7.0). An example for that are scripts which just want to check for
      submodule commits while ignoring any changes to the work tree. Also users
      having large submodules known not to change might want to use this option,
      as the - sometimes substantial - time it takes to scan the submodule work
      tree(s) is saved when using the "dirty" parameter.
      
      And if you want to ignore any changes to submodules, you can now do that
      by using this option without parameters or with "all" (when the config
      option status.submodulesummary is set, using "all" will also suppress the
      output of the submodule summary).
      
      A new function handle_ignore_submodules_arg() is introduced to parse this
      option new to "git status" in a single location, as "git diff" already
      knew it.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      46a958b3
  19. 04 6月, 2010 1 次提交
  20. 01 6月, 2010 1 次提交
    • G
      enums: omit trailing comma for portability · 4b05548f
      Gary V. Vaughan 提交于
      Without this patch at least IBM VisualAge C 5.0 (I have 5.0.2) on AIX
      5.1 fails to compile git.
      
      enum style is inconsistent already, with some enums declared on one
      line, some over 3 lines with the enum values all on the middle line,
      sometimes with 1 enum value per line... and independently of that the
      trailing comma is sometimes present and other times absent, often
      mixing with/without trailing comma styles in a single file, and
      sometimes in consecutive enum declarations.
      
      Clearly, omitting the comma is the more portable style, and this patch
      changes all enum declarations to use the portable omitted dangling
      comma style consistently.
      Signed-off-by: NGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4b05548f
  21. 10 4月, 2010 2 次提交
  22. 09 3月, 2010 1 次提交
    • J
      git status: Show detailed dirty status of submodules in long format · 9297f77e
      Jens Lehmann 提交于
      Since 1.7.0 there are three reasons a submodule is considered modified
      against the work tree: It contains new commits, modified content or
      untracked content. Lets show all reasons in the long format of git status,
      so the user can better asses the nature of the modification. This change
      does not affect the short and porcelain formats.
      
      Two new members are added to "struct wt_status_change_data" to store the
      information gathered by run_diff_files(). wt-status.c uses the new flag
      DIFF_OPT_DIRTY_SUBMODULES to tell diff-lib.c it wants to get detailed
      dirty information about submodules.
      
      A hint line for submodules is printed in the dirty header when dirty
      submodules are present.
      Signed-off-by: NJens Lehmann <Jens.Lehmann@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9297f77e
  23. 12 12月, 2009 1 次提交
    • J
      status/commit: do not suggest "reset HEAD <path>" while merging · 3c588453
      Junio C Hamano 提交于
      Suggesting "'reset HEAD <path>' to unstage" is dead wrong if we are about
      to record a merge commit.  For either an unmerged path (i.e. with
      unresolved conflicts), or an updated path, it would result in discarding
      what the other branch did.
      
      Note that we do not do anything special in a case where we are amending a
      merge.  The user is making an evil merge starting from an already
      committed merge, and running "reset HEAD <path>" is the right way to get
      rid of the local edit that has been added to the index.
      
      Once "reset --unresolve <path>" becomes available, we might want to
      suggest it for a merged path that has unresolve information, but until
      then, just remove the incorrect advice.
      
      We might also want to suggest "checkout --conflict <path>" to revert the
      file in the work tree to the state of failed automerge for an unmerged
      path, but we never did that, and this commit does not change that.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3c588453
  24. 07 12月, 2009 1 次提交
  25. 06 12月, 2009 1 次提交
  26. 23 8月, 2009 1 次提交
  27. 11 8月, 2009 4 次提交
  28. 07 8月, 2009 1 次提交
    • J
      status: show worktree status of conflicted paths separately · 4d4d5726
      Junio C Hamano 提交于
      When a path is unmerged in the index, we used to always say "unmerged" in
      the "Changed but not updated" section, even when the path was deleted in
      the work tree.
      
      Remove unmerged entries from the "Updated" section, and create a new
      section "Unmerged paths".  Describe how the different stages conflict
      in more detail in this new section.
      
      Note that with the current 3-way merge policy (with or without recursive),
      certain combinations of index stages should never happen.  For example,
      having only stage #2 means that a path that did not exist in the common
      ancestor was added by us while the other branch did not do anything to it,
      which would have autoresolved to take our addition.  The code nevertheless
      prepares for the possibility that future merge policies may leave a path
      in such a state.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4d4d5726
  29. 06 8月, 2009 1 次提交