1. 07 Nov, 2009 1 commit
    • Junio C Hamano's avatar
      builtin-commit.c: fix logic to omit empty line before existing footers · e5138436
      Junio C Hamano authored
      "commit -s" used to add an empty line before adding S-o-b line only when
      the last line of the existing log message is not another S-o-b line, but
      c1e01b0c (commit: More generous accepting of RFC-2822 footer lines.,
      2009-10-28) introduced logic to omit this empty line when the message ends
      with a run of "footer" lines, to cover S-o-b's friends, e.g. Acked-by.
      However, the logic was overzealous and missed one corner case.  A message
      that consists of a single line that begins with Token + colon, it can be
      mistaken as a S-o-b's friend.  We do want an empty line in such a case.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  2. 28 Oct, 2009 1 commit
    • David Brown's avatar
      commit: More generous accepting of RFC-2822 footer lines. · c1e01b0c
      David Brown authored
      'git commit -s' will insert a blank line before the Signed-off-by
      line at the end of the message, unless this last line is a
      Signed-off-by line itself.  Common use has other trailing lines
      at the ends of commit text, in the style of RFC2822 headers.
      Be more generous in considering lines to be part of this footer.
      If the last paragraph of the commit message reasonably resembles
      RFC-2822 formatted lines, don't insert that blank line.
      The new Signed-off-by line is still only suppressed when the
      author's existing Signed-off-by is the last line of the message.
      Signed-off-by: default avatarDavid Brown <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  3. 15 Aug, 2009 1 commit
  4. 10 Aug, 2009 2 commits
  5. 08 Aug, 2009 1 commit
    • Junio C Hamano's avatar
      commit: --dry-run · 3a5d13a3
      Junio C Hamano authored
      This teaches --dry-run option to "git commit".
      It is the same as "git status", but in the longer term we would want to
      change the semantics of "git status" not to be the preview of commit, and
      this is the first step for doing so.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  6. 06 Aug, 2009 1 commit
  7. 27 Jun, 2009 2 commits
  8. 25 May, 2009 2 commits
    • Stephen Boyd's avatar
      parse-opts: add OPT_FILENAME and transition builtins · df217ed6
      Stephen Boyd authored
      Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
      2008-08-06) introduced parse_options_fix_filename() as a minimal fix.
      OPT_FILENAME is intended to be a more robust fix for the same issue.
      OPT_FILENAME and its associated enum OPTION_FILENAME are used to
      represent filename options within the parse options API.
      This option is similar to OPTION_STRING. If --no is prefixed to the
      option the filename is unset. If no argument is given and the default
      value is set, the filename is set to the default value. The difference
      is that the filename is prefixed with the prefix passed to
      parse_options() (or parse_options_start()).
      Update git-apply, git-commit, git-fmt-merge-msg, and git-tag to use
      OPT_FILENAME with their filename options. Also, rename
      parse_options_fix_filename() to fix_filename() as it is no longer
      Signed-off-by: default avatarStephen Boyd <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
    • Stephen Boyd's avatar
      parse-opts: prepare for OPT_FILENAME · 37782920
      Stephen Boyd authored
      To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
      which passes the prefix to parse_options_start() which sets the prefix
      member of parse_opts_ctx accordingly. If there isn't a prefix in the
      calling context, passing NULL will suffice.
      Signed-off-by: default avatarStephen Boyd <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  9. 23 May, 2009 1 commit
    • Stephen Boyd's avatar
      commit: -F overrides -t · aae94ffb
      Stephen Boyd authored
      Commit dbd0f5c7 (Files given on the command line are relative to $cwd,
      2008-08-06) introduced parse_options_fix_filename() as a quick fix for
      filename arguments used in the parse options API.
      git-commit was still broken. This means
          git commit -F log -t temp
      in a subdirectory would make git think the log message should be taken
      from temp instead of log.
      This is because parse_options_fix_filename() calls prefix_filename()
      which uses a single static char buffer to do its work. Making two calls
      with two char pointers causes the pointers to alias. To prevent
      aliasing, we duplicate the string returned by
      Signed-off-by: default avatarStephen Boyd <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  10. 05 Apr, 2009 1 commit
  11. 11 Feb, 2009 1 commit
    • Stephan Beyer's avatar
      Generalize and libify index_is_dirty() to index_differs_from(...) · 75f3ff2e
      Stephan Beyer authored
      index_is_dirty() in builtin-revert.c checks if the index is dirty.
      This patch generalizes this function to check if the index differs
      from a revision, i.e. the former index_is_dirty() behavior can now be
      achieved by index_differs_from("HEAD", 0).
      The second argument "diff_flags" allows to set further diff option
      flags like DIFF_OPT_IGNORE_SUBMODULES. See DIFF_OPT_* macros in diff.h
      for a list.
      index_differs_from() seems to be useful for more than builtin-revert.c,
      so it is moved into diff-lib.c and also used in builtin-commit.c.
      Yet to mention:
       - "rev.abbrev = 0;" can be safely removed.
         This has no impact on performance or functioning of neither
         setup_revisions() nor run_diff_index().
       - rev.pending.objects is free()d because this fixes a leak.
         (Also see 295dd2ad "Fix memory leak in traverse_commit_list")
      Mentored-by: default avatarDaniel Barkalow <[email protected]>
      Mentored-by: Christian Couder's avatarChristian Couder <[email protected]>
      Signed-off-by: default avatarStephan Beyer <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  12. 20 Jan, 2009 1 commit
  13. 18 Jan, 2009 2 commits
  14. 15 Jan, 2009 1 commit
  15. 09 Jan, 2009 2 commits
  16. 13 Dec, 2008 1 commit
  17. 01 Dec, 2008 1 commit
  18. 15 Nov, 2008 1 commit
    • Linus Torvalds's avatar
      Add cache preload facility · 671c9b7e
      Linus Torvalds authored
      This can do the lstat() storm in parallel, giving potentially much
      improved performance for cold-cache cases or things like NFS that have
      weak metadata caching.
      Just use "read_cache_preload()" instead of "read_cache()" to force an
      optimistic preload of the index stat data.  The function takes a
      pathspec as its argument, allowing us to preload only the relevant
      portion of the index.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  19. 12 Nov, 2008 1 commit
    • Jeff King's avatar
      commit: Fix stripping of patch in verbose mode. · 0b38227f
      Jeff King authored
      When the "-v" option is given, we put diff of what is to be committed into
      the commit template, and then strip it back out again after the user has
      edited it.
      We used to look for the diff by searching for the "diff --git a/"
      header. With diff.mnemonicprefix set in the configuration, however, this
      pattern does not match.  The pattern is loosened to cover this case.
      Also, if the user puts their own diff in the message (e.g., as a sample
      output), then we will accidentally trigger the pattern, removing part of
      their output.
      We can avoid doing this stripping altogether if the user didn't use "-v"
      in the first place, so we know that any match we find will be a false
      [jc: this fix was split out of a series originally meant for master.]
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  20. 19 Oct, 2008 1 commit
  21. 12 Oct, 2008 1 commit
  22. 03 Oct, 2008 2 commits
    • Miklos Vajna's avatar
      builtin-commit: use reduce_heads() only when appropriate · cf10f9fd
      Miklos Vajna authored
      Since commit 6bb6b034 (builtin-commit: use commit_tree(), 2008-09-10),
      builtin-commit performs a reduce_heads() unconditionally.  However,
      it's not always needed, and in some cases even harmful.
      reduce_heads() is not needed for the initial commit or for an
      "ordinary" commit, because they don't have any or have only one
      parent, respectively.
      reduce_heads() must be avoided when 'git commit' is run after a 'git
      merge --no-ff --no-commit', otherwise it will turn the
      non-fast-forward merge into fast-forward.  For the same reason,
      reduce_heads() must be avoided when amending such a merge commit.
      To resolve this issue, 'git merge' will write info about whether
      fast-forward is allowed or not to $GIT_DIR/MERGE_MODE.  Based on this
      info, 'git commit' will only perform reduce_heads() when it's
      committing a merge and fast-forward is enabled.
      Also add test cases to ensure that non-fast-forward merges are
      committed and amended properly.
      Signed-off-by: default avatarMiklos Vajna <[email protected]>
      Signed-off-by: default avatarSZEDER Gábor <[email protected]>
      Signed-off-by: default avatarShawn O. Pearce <[email protected]>
    • Jeff King's avatar
      reformat informational commit message · c85db254
      Jeff King authored
      When committing, we print a message like:
        Created [DETACHED commit] <hash> (<subject>) on <branch>
      The most useful bit of information there (besides the
      detached status, if it is present) is which branch you made
      the commit on. However,  it is sometimes hard to see because
      the subject dominates the line.
      Instead, let's put the most useful information (detached
      status and commit branch) on the far left, with the subject
      (which is least likely to be interesting) on the far right.
      We'll use brackets to offset the branch name so the line is
      not mistaken for an error line of the form "program: some
      sort of error". E.g.,:
        [jk/bikeshed] created bd8098f: "reformat informational commit message"
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarShawn O. Pearce <[email protected]>
  23. 30 Sep, 2008 1 commit
    • Andreas Ericsson's avatar
      git commit: Reformat output somewhat · 72c69ebc
      Andreas Ericsson authored
      Previously, we used to print something along the lines of
      	Created commit abc9056 on master: Snib the sprock
      but that output was sometimes confusing, as many projects use
      the "subsystem: message" style of commit subjects (just like
      this commit message does). When such improvements are done on
      topic-branches, it's not uncommon to name the topic-branch the
      same as the subsystem, leading to output like this:
      	Created commit abc9056 on i386: i386: Snib the sprock
      which doesn't look very nice and can be highly confusing.
      This patch alters the format so that the noise-word "commit"
      is dropped except when it makes the output read better and
      the commit subject is put inside parentheses. We also
      emphasize the detached case so that users do not overlook it
      in case the commit subject is long enough to extend to the
      next line. The end result looks thusly:
      	normal case
      	Created abc9056 (i386: Snib the sprock) on i386
      	detached head
      	Created DETACHED commit abc9056 (i386: Snib the sprock)
      While we're at it, we rename "initial commit" to "root-commit"
      to align it with the argument to 'git log', producing this:
      	initial commit
      	Created root-commit abc9056 (i386: Snib the sprock) on i386
      Documentation/gittutorial-2.txt is updated accordingly so that
      new users recognize what they're looking at.
      Signed-off-by: default avatarAndreas Ericsson <[email protected]>
      Signed-off-by: default avatarShawn O. Pearce <[email protected]>
  24. 29 Sep, 2008 1 commit
  25. 10 Sep, 2008 1 commit
  26. 07 Sep, 2008 1 commit
  27. 31 Aug, 2008 2 commits
  28. 29 Aug, 2008 1 commit
  29. 06 Aug, 2008 1 commit
    • Junio C Hamano's avatar
      Files given on the command line are relative to $cwd · dbd0f5c7
      Junio C Hamano authored
      When running "git commit -F file" and "git tag -F file" from a
      subdirectory, we should take it as relative to the directory we started
      from, not relative to the top-level directory.
      This adds a helper function "parse_options_fix_filename()" to make it more
      convenient to fix this class of issues.  Ideally, parse_options() should
      support a new type of option, "OPT_FILENAME", to do this uniformly, but
      this patch is meant to go to 'maint' to fix it minimally.
      One thing to note is that value for "commit template file" that comes from
      the command line is taken as relative to $cwd just like other parameters,
      but when it comes from the configuration varilable 'commit.template', it
      is taken as relative to the working tree root as before.  I think this
      difference actually is sensible (not that I particularly think
      commit.template itself is sensible).
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  30. 31 Jul, 2008 1 commit
    • Jeff King's avatar
      Compact commit template message · fdc7c811
      Jeff King authored
      We recently let the user know explicitly that an empty
      commit message will abort the commit. However, this adds yet
      another line to the template; let's rephrase and re-wrap so
      that this fits back on two lines.
      This patch also makes the "fatal: empty commit message?"
      warning a bit less scary, since this is now a "feature"
      instead of an error. However, we retain the non-zero exit
      status to indicate to callers that nothing was committed.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  31. 30 Jul, 2008 1 commit
  32. 26 Jul, 2008 1 commit
  33. 24 Jul, 2008 1 commit