1. 01 4月, 2014 1 次提交
  2. 25 3月, 2014 1 次提交
    • J
      parse-options: multi-word argh should use dash to separate words · e703d711
      Junio C Hamano 提交于
      "When you need to use space, use dash" is a strange way to say that
      you must not use a space.  Because it is more common for the command
      line descriptions to use dashed-multi-words, you do not even want to
      use spaces in these places.  Rephrase the documentation to avoid
      this strangeness.
      
      Fix a few existing multi-word argument help strings, i.e.
      
       - GPG key-ids given to -S/--gpg-sign are "key-id";
       - Refs used for storing notes are "notes-ref"; and
       - Expiry timestamps given to --expire are "expiry-date".
      
      and update the corresponding documentation pages.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e703d711
  3. 19 3月, 2014 1 次提交
  4. 26 2月, 2014 1 次提交
  5. 25 2月, 2014 2 次提交
  6. 01 2月, 2014 1 次提交
  7. 06 12月, 2013 2 次提交
    • 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
    • C
      replace {pre,suf}fixcmp() with {starts,ends}_with() · 59556548
      Christian Couder 提交于
      Leaving only the function definitions and declarations so that any
      new topic in flight can still make use of the old functions, replace
      existing uses of the prefixcmp() and suffixcmp() with new API
      functions.
      
      The change can be recreated by mechanically applying this:
      
          $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
            grep -v strbuf\\.c |
            xargs perl -pi -e '
              s|!prefixcmp\(|starts_with\(|g;
              s|prefixcmp\(|!starts_with\(|g;
              s|!suffixcmp\(|ends_with\(|g;
              s|suffixcmp\(|!ends_with\(|g;
            '
      
      on the result of preparatory changes in this series.
      Signed-off-by: NChristian Couder <chriscool@tuxfamily.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      59556548
  8. 25 10月, 2013 1 次提交
  9. 13 9月, 2013 3 次提交
    • M
      commit: disable status hints when writing to COMMIT_EDITMSG · ea9882bf
      Matthieu Moy 提交于
      This turns the template COMMIT_EDITMSG from e.g
      
        # [...]
        # Changes to be committed:
        #   (use "git reset HEAD <file>..." to unstage)
        #
        #	modified:   builtin/commit.c
        #
        # Untracked files:
        #   (use "git add <file>..." to include in what will be committed)
        #
        #	t/foo
        #
      
      to
      
        # [...]
        # Changes to be committed:
        #	modified:   builtin/commit.c
        #
        # Untracked files:
        #	t/foo
        #
      
      Most status hints were written to be accurate when running "git status"
      before running a commit. Many of them are not applicable when the commit
      has already been started, and should not be shown in COMMIT_EDITMSG. The
      most obvious are hints advising to run "git commit",
      "git rebase/am/cherry-pick --continue", which do not make sense when the
      command has already been run.
      
      Other messages become slightly inaccurate (e.g. hint to use "git add" to
      add untracked files), as the suggested commands are not immediately
      applicable during the editing of COMMIT_EDITMSG, but would be applicable
      if the commit is aborted. These messages are both potentially helpful and
      slightly misleading. This patch chose to remove them too, to avoid
      introducing too much complexity in the status code.
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ea9882bf
    • M
      wt-status: turn advice_status_hints into a field of wt_status · 6a964f57
      Matthieu Moy 提交于
      No behavior change in this patch, but this makes the display of status
      hints more flexible as they can be enabled or disabled for individual
      calls to commit.c:run_status().
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6a964f57
    • M
      commit: factor status configuration is a helper function · 5c25dfaa
      Matthieu Moy 提交于
      cmd_commit and cmd_status use very similar code to initialize the
      wt_status structure. Factor this code into a function to ensure future
      changes will keep both versions consistent.
      Signed-off-by: NMatthieu Moy <Matthieu.Moy@imag.fr>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5c25dfaa
  10. 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
  11. 31 8月, 2013 1 次提交
  12. 25 8月, 2013 1 次提交
  13. 07 8月, 2013 1 次提交
  14. 06 8月, 2013 2 次提交
  15. 29 7月, 2013 1 次提交
    • J
      commit: tweak empty cherry pick advice for sequencer · c17592a7
      Jeff King 提交于
      When we refuse to make an empty commit, we check whether we
      are in a cherry-pick in order to give better advice on how
      to proceed. We instruct the user to repeat the commit with
      "--allow-empty" to force the commit, or to use "git reset"
      to skip it and abort the cherry-pick.
      
      In the case of a single cherry-pick, the distinction between
      skipping and aborting is not important, as there is no more
      work to be done afterwards.  When we are using the sequencer
      to cherry pick a series of commits, though, the instruction
      is confusing: does it skip this commit, or does it abort the
      rest of the cherry-pick?
      
      It does skip, after which the user can continue the
      cherry-pick. This is the right thing to be advising the user
      to do, but let's make it more clear what will happen, both
      by using the word "skip", and by mentioning that the rest of
      the sequence can be continued via "cherry-pick --continue"
      (whether we skip or take the commit).
      Noticed-by: NRamkumar Ramachandra <artagnon@gmail.com>
      Helped-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c17592a7
  16. 16 7月, 2013 8 次提交
  17. 10 7月, 2013 1 次提交
    • N
      Convert "struct cache_entry *" to "const ..." wherever possible · 9c5e6c80
      Nguyễn Thái Ngọc Duy 提交于
      I attempted to make index_state->cache[] a "const struct cache_entry **"
      to find out how existing entries in index are modified and where. The
      question I have is what do we do if we really need to keep track of on-disk
      changes in the index. The result is
      
       - diff-lib.c: setting CE_UPTODATE
      
       - name-hash.c: setting CE_HASHED
      
       - preload-index.c, read-cache.c, unpack-trees.c and
         builtin/update-index: obvious
      
       - entry.c: write_entry() may refresh the checked out entry via
         fill_stat_cache_info(). This causes "non-const struct cache_entry
         *" in builtin/apply.c, builtin/checkout-index.c and
         builtin/checkout.c
      
       - builtin/ls-files.c: --with-tree changes stagemask and may set
         CE_UPDATE
      
      Of these, write_entry() and its call sites are probably most
      interesting because it modifies on-disk info. But this is stat info
      and can be retrieved via refresh, at least for porcelain
      commands. Other just uses ce_flags for local purposes.
      
      So, keeping track of "dirty" entries is just a matter of setting a
      flag in index modification functions exposed by read-cache.c. Except
      unpack-trees, the rest of the code base does not do anything funny
      behind read-cache's back.
      
      The actual patch is less valueable than the summary above. But if
      anyone wants to re-identify the above sites. Applying this patch, then
      this:
      
          diff --git a/cache.h b/cache.h
          index 430d021..1692891 100644
          --- a/cache.h
          +++ b/cache.h
          @@ -267,7 +267,7 @@ static inline unsigned int canon_mode(unsigned int mode)
           #define cache_entry_size(len) (offsetof(struct cache_entry,name) + (len) + 1)
      
           struct index_state {
          -	struct cache_entry **cache;
          +	const struct cache_entry **cache;
           	unsigned int version;
           	unsigned int cache_nr, cache_alloc, cache_changed;
           	struct string_list *resolve_undo;
      
      will help quickly identify them without bogus warnings.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9c5e6c80
  18. 25 6月, 2013 4 次提交
  19. 24 6月, 2013 1 次提交
  20. 16 6月, 2013 1 次提交
  21. 13 6月, 2013 2 次提交
    • J
      Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c · 49c24704
      Johan Herland 提交于
      This is a pure code movement of the machinery for copying notes to
      rewritten objects. This code was located in builtin/notes.c for
      historical reasons. In order to make it available to builtin/commit.c
      it was declared in builtin.h. This was more of an accident of history
      than a concious design, and we now want to make this machinery more
      widely available.
      
      Hence, this patch moves the code into the new notes-utils.[hc] files
      which are included into libgit.a. Except for adjusting #includes
      accordingly, this patch merely moves the relevant functions verbatim
      into the new files.
      
      Cc: Thomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      49c24704
    • J
      finish_copy_notes_for_rewrite(): Let caller provide commit message · 80a14665
      Johan Herland 提交于
      When copying notes for a rewritten object, the resulting notes commit
      would have the following hardcoded commit message:
      
        Notes added by 'git notes copy'
      
      This is obviously bogus when the notes rewriting is performed by
      'git commit --amend'.
      
      Therefore, let the caller specify an appropriate notes commit message
      instead of hardcoding it. The above message is used for 'git notes copy',
      but when calling finish_copy_notes_for_rewrite() from builtin/commit.c,
      we use the following message instead:
      
        Notes added by 'git commit --amend'
      
      Cc: Thomas Rast <trast@inf.ethz.ch>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80a14665
  22. 12 6月, 2013 1 次提交
  23. 29 5月, 2013 1 次提交
  24. 19 4月, 2013 1 次提交