1. 13 Jul, 2013 1 commit
    • Eric Sunshine's avatar
      builtin: add git-check-mailmap command · 226ad348
      Eric Sunshine authored
      Introduce command check-mailmap, similar to check-attr and check-ignore,
      which allows direct testing of .mailmap configuration.
      
      As plumbing accessible to scripts and other porcelain, check-mailmap
      publishes the stable, well-tested .mailmap functionality employed by
      built-in Git commands.  Consequently, script authors need not
      re-implement .mailmap functionality manually, thus avoiding potential
      quirks and behavioral differences.
      Signed-off-by: Eric Sunshine's avatarEric Sunshine <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      226ad348
  2. 12 Jun, 2013 2 commits
    • Johan Herland's avatar
      Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c · 49c24704
      Johan Herland authored
      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 <[email protected]>
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      49c24704
    • Johan Herland's avatar
      finish_copy_notes_for_rewrite(): Let caller provide commit message · 80a14665
      Johan Herland authored
      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 <[email protected]>
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      80a14665
  3. 28 May, 2013 1 commit
    • Duy Nguyen's avatar
      prune-packed: avoid implying "1" is DRY_RUN in prune_packed_objects() · af0b4a3b
      Duy Nguyen authored
      Commit b60daf05 (Make git-prune-packed a bit more chatty. - 2007-01-12)
      changes the meaning of prune_packed_objects()'s argument, from "dry
      run or not dry run" to a bitmap.
      
      It however forgot to update prune_packed_objects() caller in
      builtin/prune.c to use new DRY_RUN macro. It's fine (for a long time!)
      but there is a risk that someday someone may change the value of
      DRY_RUN to something else and builtin/prune.c suddenly breaks. Avoid
      that possibility.
      
      While at there, change "opts == VERBOSE" to "opts & VERBOSE" as there
      is no obvious reason why we only be chatty when DRY_RUN is not set.
      Signed-off-by: Duy Nguyen's avatarNguyễn Thái Ngọc Duy <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      af0b4a3b
  4. 06 Jan, 2013 1 commit
  5. 28 Dec, 2012 1 commit
    • Junio C Hamano's avatar
      merge --no-edit: do not credit people involved in the side branch · 9bcbb1c2
      Junio C Hamano authored
      The credit lines "By" and "Via" to credit authors and committers for
      their contributions on the side branch are meant as a hint to the
      integrator to decide whom to mention in the log message text.  After
      the integrator saves the message in the editor, they are meant to go
      away and that is why they are commented out.
      
      When a merge is recorded without editing the generated message,
      however, its contents do not go through the normal stripspace()
      and these lines are left in the merge.
      
      Stop producing them when we know the merge is going to be recorded
      without editing, i.e. when --no-edit is given.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      9bcbb1c2
  6. 29 Oct, 2012 1 commit
  7. 16 Sep, 2012 1 commit
  8. 29 Jul, 2012 1 commit
    • Jeff King's avatar
      diff: do not use null sha1 as a sentinel value · e5450100
      Jeff King authored
      The diff code represents paths using the diff_filespec
      struct. This struct has a sha1 to represent the sha1 of the
      content at that path, as well as a sha1_valid member which
      indicates whether its sha1 field is actually useful. If
      sha1_valid is not true, then the filespec represents a
      working tree file (e.g., for the no-index case, or for when
      the index is not up-to-date).
      
      The diff_filespec is only used internally, though. At the
      interfaces to the diff subsystem, callers feed the sha1
      directly, and we create a diff_filespec from it. It's at
      that point that we look at the sha1 and decide whether it is
      valid or not; callers may pass the null sha1 as a sentinel
      value to indicate that it is not.
      
      We should not typically see the null sha1 coming from any
      other source (e.g., in the index itself, or from a tree).
      However, a corrupt tree might have a null sha1, which would
      cause "diff --patch" to accidentally diff the working tree
      version of a file instead of treating it as a blob.
      
      This patch extends the edges of the diff interface to accept
      a "sha1_valid" flag whenever we accept a sha1, and to use
      that flag when creating a filespec. In some cases, this
      means passing the flag through several layers, making the
      code change larger than would be desirable.
      
      One alternative would be to simply die() upon seeing
      corrupted trees with null sha1s. However, this fix more
      directly addresses the problem (while bogus sha1s in a tree
      are probably a bad thing, it is really the sentinel
      confusion sending us down the wrong code path that is what
      makes it devastating). And it means that git is more capable
      of examining and debugging these corrupted trees. For
      example, you can still "diff --raw" such a tree to find out
      when the bogus entry was introduced; you just cannot do a
      "--patch" diff (just as you could not with any other
      corrupted tree, as we do not have any content to diff).
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e5450100
  9. 25 Jun, 2012 1 commit
  10. 15 Jun, 2012 2 commits
    • Jeff King's avatar
      fix pager.diff with diff --no-index · 1af3d977
      Jeff King authored
      git-diff does not rely on the git wrapper to setup its
      pager; instead, it sets it up on its own after seeing
      whether --quiet or --exit-code has been specified.  After
      diff_no_index was split off from cmd_diff, commit b3fde6cc
      (git diff --no-index: default to page like other diff
      frontends, 2008-05-26) duplicated the one-liner from
      cmd_diff to turn on the pager.
      
      Later, commit 8f0359f0 (Allow pager of diff command be
      enabled/disabled, 2008-07-21) taught the the version in
      cmd_diff to respect the pager.diff config, but the version
      in diff_no_index was left behind. This meant that
      
        git -c pager.diff=0 diff a b
      
      would not use a pager, but
      
        git -c pager.diff=0 diff --no-index a b
      
      would.  Let's fix it by factoring out a common function.
      
      While we're there, let's update the antiquated comment,
      which claims that the pager interferes with propagating the
      exit code; this has not been the case since ea27a18c (spawn
      pager via run_command interface, 2008-07-22).
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1af3d977
    • Luka Perkov's avatar
      builtin.h: remove unused cmd_<foo> declarations · 0feb7c66
      Luka Perkov authored
      These were left in builtin.h after they were converted into
      stand-alone programs or removed after experiments finished.
      Signed-off-by: default avatarLuka Perkov <[email protected]>
      Helped-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      0feb7c66
  11. 03 Jun, 2012 1 commit
  12. 27 Apr, 2012 1 commit
  13. 21 Nov, 2011 1 commit
  14. 07 Nov, 2011 1 commit
  15. 14 Jul, 2011 1 commit
  16. 30 Jun, 2011 1 commit
    • Jeff King's avatar
      git skew: a tool to find how big a clock skew exists in the history · 188c35e3
      Jeff King authored
      > As you probably guessed from the specificity of the number, I wrote a
      > short program to actually traverse and find the worst skew. It takes
      > about 5 seconds to run (unsurprisingly, since it is doing the same full
      > traversal that we end up doing in the above numbers). So we could
      > "autoskew" by setting up the configuration on clone, and then
      > periodically updating it as part of "git gc".
      
      This patch doesn't implement auto-detection of skew, but is the program
      I used to calculate, and would provide the basis for such
      auto-detection. It would be interesting to see average skew numbers for
      popular repositories. You can run it as "git skew --all".
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      Signed-off-by: Ævar Arnfjörð Bjarmason's avatarÆvar Arnfjörð Bjarmason <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      188c35e3
  17. 13 Feb, 2011 1 commit
  18. 17 Nov, 2010 1 commit
  19. 13 Oct, 2010 2 commits
  20. 29 Sep, 2010 1 commit
  21. 09 Sep, 2010 1 commit
  22. 01 Sep, 2010 1 commit
  23. 24 Jun, 2010 1 commit
  24. 18 Jun, 2010 1 commit
  25. 10 May, 2010 1 commit
  26. 02 Apr, 2010 1 commit
    • Jeff King's avatar
      make commit_tree a library function · 40d52ff7
      Jeff King authored
      Until now, this has been part of the commit-tree builtin.
      However, it is already used by other builtins (like commit,
      merge, and notes), and it would be useful to access it from
      library code.
      
      The check_valid helper has to come along, too, but is given
      a more library-ish name of "assert_sha1_type".
      
      Otherwise, the code is unchanged. There are still a few
      rough edges for a library function, like printing the utf8
      warning to stderr, but we can address those if and when they
      come up as inappropriate.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      40d52ff7
  27. 13 Mar, 2010 1 commit
  28. 14 Feb, 2010 1 commit
    • Johan Herland's avatar
      Builtin-ify git-notes · cd067d3b
      Johan Herland authored
      The builtin-ification includes some minor behavioural changes to the
      command-line interface: It is no longer allowed to mix the -m and -F
      arguments, and it is not allowed to use multiple -F options.
      
      As part of the builtin-ification, we add the commit_notes() function
      to the builtin API. This function (together with the notes.h API) can
      be easily used from other builtins to manipulate the notes tree.
      
      Also includes needed changes to t3301.
      
      This patch has been improved by the following contributions:
      - Stephen Boyd: Use die() instead of fprintf(stderr, ...) followed by exit(1)
      
      Cc: Stephen Boyd <[email protected]>
      Signed-off-by: default avatarJohan Herland <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      cd067d3b
  29. 22 Jan, 2010 9 commits