1. 04 11月, 2007 1 次提交
  2. 02 11月, 2007 1 次提交
    • J
      format-patch -s: add MIME encoding header if signer's name requires so · 4593fb84
      Junio C Hamano 提交于
      When the body of the commit log message contains a non-ASCII character,
      format-patch correctly emitted the encoding header to mark the resulting
      message as such.  However, if the original message was fully ASCII, the
      command line switch "-s" was given to add a new sign-off, and
      the signer's name was not ASCII only, the resulting message would have
      contained non-ASCII character but was not marked as such.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4593fb84
  3. 19 9月, 2007 1 次提交
  4. 14 9月, 2007 1 次提交
  5. 11 9月, 2007 1 次提交
  6. 28 8月, 2007 2 次提交
  7. 05 7月, 2007 1 次提交
  8. 03 7月, 2007 1 次提交
  9. 28 6月, 2007 1 次提交
  10. 23 6月, 2007 1 次提交
    • L
      Finally implement "git log --follow" · 750f7b66
      Linus Torvalds 提交于
      Ok, I've really held off doing this too damn long, because I'm lazy, and I
      was always hoping that somebody else would do it.
      
      But no, people keep asking for it, but nobody actually did anything, so I
      decided I might as well bite the bullet, and instead of telling people
      they could add a "--follow" flag to "git log" to do what they want to do,
      I decided that it looks like I just have to do it for them..
      
      The code wasn't actually that complicated, in that the diffstat for this
      patch literally says "70 insertions(+), 1 deletions(-)", but I will have
      to admit that in order to get to this fairly simple patch, you did have to
      know and understand the internal git diff generation machinery pretty
      well, and had to really be able to follow how commit generation interacts
      with generating patches and generating the log.
      
      So I suspect that while I was right that it wasn't that hard, I might have
      been expecting too much of random people - this patch does seem to be
      firmly in the core "Linus or Junio" territory.
      
      To make a long story short: I'm sorry for it taking so long until I just
      did it.
      
      I'm not going to guarantee that this works for everybody, but you really
      can just look at the patch, and after the appropriate appreciative noises
      ("Ooh, aah") over how clever I am, you can then just notice that the code
      itself isn't really that complicated.
      
      All the real new code is in the new "try_to_follow_renames()" function. It
      really isn't rocket science: we notice that the pathname we were looking
      at went away, so we start a full tree diff and try to see if we can
      instead make that pathname be a rename or a copy from some other previous
      pathname. And if we can, we just continue, except we show *that*
      particular diff, and ever after we use the _previous_ pathname.
      
      One thing to look out for: the "rename detection" is considered to be a
      singular event in the _linear_ "git log" output! That's what people want
      to do, but I just wanted to point out that this patch is *not* carrying
      around a "commit,pathname" kind of pair and it's *not* going to be able to
      notice the file coming from multiple *different* files in earlier history.
      
      IOW, if you use "git log --follow", then you get the stupid CVS/SVN kind
      of "files have single identities" kind of semantics, and git log will just
      pick the identity based on the normal move/copy heuristics _as_if_ the
      history could be linearized.
      
      Put another way: I think the model is broken, but given the broken model,
      I think this patch does just about as well as you can do. If you have
      merges with the same "file" having different filenames over the two
      branches, git will just end up picking _one_ of the pathnames at the point
      where the newer one goes away. It never looks at multiple pathnames in
      parallel.
      
      And if you understood all that, you probably didn't need it explained, and
      if you didn't understand the above blathering, it doesn't really mtter to
      you. What matters to you is that you can now do
      
      	git log -p --follow builtin-rev-list.c
      
      and it will find the point where the old "rev-list.c" got renamed to
      "builtin-rev-list.c" and show it as such.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      750f7b66
  11. 13 6月, 2007 1 次提交
    • J
      Lift 16kB limit of log message output · 80583c0e
      Junio C Hamano 提交于
      Traditionally we had 16kB limit when formatting log messages for
      output, because it was easier to arrange for the caller to have
      a reasonably big buffer and pass it down without ever worrying
      about reallocating.
      
      This changes the calling convention of pretty_print_commit() to
      lift this limit.  Instead of the buffer and remaining length, it
      now takes a pointer to the pointer that points at the allocated
      buffer, and another pointer to the location that stores the
      allocated length, and reallocates the buffer as necessary.
      
      To support the user format, the error return of interpolate()
      needed to be changed.  It used to return a bool telling "Ok the
      result fits", or "Sorry, I had to truncate it".  Now it returns
      0 on success, and returns the size of the buffer it wants in
      order to fit the whole result.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      80583c0e
  12. 09 6月, 2007 1 次提交
  13. 06 6月, 2007 1 次提交
  14. 15 5月, 2007 1 次提交
  15. 17 4月, 2007 1 次提交
  16. 13 4月, 2007 1 次提交
  17. 12 4月, 2007 2 次提交
  18. 20 3月, 2007 1 次提交
  19. 05 3月, 2007 1 次提交
  20. 27 2月, 2007 1 次提交
    • N
      convert object type handling from a string to a number · 21666f1a
      Nicolas Pitre 提交于
      We currently have two parallel notation for dealing with object types
      in the code: a string and a numerical value.  One of them is obviously
      redundent, and the most used one requires more stack space and a bunch
      of strcmp() all over the place.
      
      This is an initial step for the removal of the version using a char array
      found in object reading code paths.  The patch is unfortunately large but
      there is no sane way to split it in smaller parts without breaking the
      system.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      21666f1a
  21. 24 2月, 2007 1 次提交
  22. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  23. 09 2月, 2007 1 次提交
  24. 28 1月, 2007 1 次提交
    • J
      Don't force everybody to call setup_ident(). · 01754769
      Junio C Hamano 提交于
      Back when only handful commands that created commit and tag were
      the only users of committer identity information, it made sense
      to explicitly call setup_ident() to pre-fill the default value
      from the gecos information.  But it is much simpler for programs
      to make the call automatic when get_ident() is called these days,
      since many more programs want to use the information when updating
      the reflog.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      01754769
  25. 26 1月, 2007 1 次提交
    • J
      Allow non-developer to clone, checkout and fetch more easily. · cb280e10
      Junio C Hamano 提交于
      The code that uses committer_info() in reflog can barf and die
      whenever it is asked to update a ref.  And I do not think
      calling ignore_missing_committer_name() upfront like recent
      receive-pack did in the aplication is a reasonable workaround.
      
      What the patch does.
      
       - git_committer_info() takes one parameter.  It used to be "if
         this is true, then die() if the name is not available due to
         bad GECOS, otherwise issue a warning once but leave the name
         empty".  The reason was because we wanted to prevent bad
         commits from being made by git-commit-tree (and its
         callers).  The value 0 is only used by "git var -l".
      
         Now it takes -1, 0 or 1.  When set to -1, it does not
         complain but uses the pw->pw_name when name is not
         available.  Existing 0 and 1 values mean the same thing as
         they used to mean before.  0 means issue warnings and leave
         it empty, 1 means barf and die.
      
       - ignore_missing_committer_name() and its existing caller
         (receive-pack, to set the reflog) have been removed.
      
       - git-format-patch, to come up with the phoney message ID when
         asked to thread, now passes -1 to git_committer_info().  This
         codepath uses only the e-mail part, ignoring the name.  It
         used to barf and die.  The other call in the same program
         when asked to add signed-off-by line based on committer
         identity still passes 1 to make sure it barfs instead of
         adding a bogus s-o-b line.
      
       - log_ref_write in refs.c, to come up with the name to record
         who initiated the ref update in the reflog, passes -1.  It
         used to barf and die.
      
      The last change means that git-update-ref, git-branch, and
      commit walker backends can now be used in a repository with
      reflog by somebody who does not have the user identity required
      to make a commit.  They all used to barf and die.
      
      I've run tests and all of them seem to pass, and also tried "git
      clone" as a user whose GECOS is empty -- git clone works again
      now (it was broken when reflog was enabled by default).
      
      But this definitely needs extra sets of eyeballs.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cb280e10
  26. 23 1月, 2007 1 次提交
  27. 21 1月, 2007 1 次提交
  28. 18 1月, 2007 6 次提交
  29. 28 12月, 2006 1 次提交
    • J
      UTF-8: introduce i18n.logoutputencoding. · d2c11a38
      Junio C Hamano 提交于
      It is plausible for somebody to want to view the commit log in a
      different encoding from i18n.commitencoding -- the project's
      policy may be UTF-8 and the user may be using a commit message
      hook to run iconv to conform to that policy (and either not have
      i18n.commitencoding to default to UTF-8 or have it explicitly
      set to UTF-8).  Even then, Latin-1 may be more convenient for
      the usual pager and the terminal the user uses.
      
      The new variable i18n.logoutputencoding is used in preference to
      i18n.commitencoding to decide what encoding to recode the log
      output in when git-log and friends formats the commit log message.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d2c11a38
  30. 26 12月, 2006 1 次提交
    • J
      Teach log family --encoding · 52883fbd
      Junio C Hamano 提交于
      Updated commit objects record the encoding used in their
      encoding header.  This updates the log family to reencode it
      into the encoding specified in i18n.commitencoding (or the
      default, which is "utf-8") upon output.
      
      To force a specific encoding that is different, log family takes
      command line flag --encoding=<encoding>; giving --encoding=none
      entirely disables the reencoding and lets you view log messges
      in their original encoding.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      52883fbd
  31. 21 12月, 2006 1 次提交
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85023577
  32. 14 12月, 2006 1 次提交
  33. 13 12月, 2006 1 次提交
    • A
      Allow subcommand.color and color.subcommand color configuration · a159ca0c
      Andy Parkins 提交于
      While adding colour to the branch command it was pointed out that a
      config option like "branch.color" conflicts with the pre-existing
      "branch.something" namespace used for specifying default merge urls and
      branches.  The suggested solution was to flip the order of the
      components to "color.branch", which I did for colourising branch.
      
      This patch does the same thing for
        - git-log (color.diff)
        - git-status (color.status)
        - git-diff (color.diff)
        - pager (color.pager)
      
      I haven't removed the old config options; but they should probably be
      deprecated and eventually removed to prevent future namespace
      collisions.  I've done this deprecation by changing the documentation
      for the config file to match the new names; and adding the "color.XXX"
      options to contrib/completion/git-completion.bash.
      
      Unfortunately git-svn reads "diff.color" and "pager.color"; which I
      don't like to change unilaterally.
      Signed-off-by: NAndy Parkins <andyparkins@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a159ca0c