1. 19 2月, 2008 1 次提交
  2. 27 12月, 2007 1 次提交
  3. 12 12月, 2007 1 次提交
    • J
      shortlog: default to HEAD when the standard input is a tty · 3384a2df
      Junio C Hamano 提交于
      Instead of warning the user that it is expecting git log output from
      the standard input (and waiting for the user to type the log from
      the keyboard, which is a silly thing to do), default to traverse from
      HEAD when there is no rev parameter given and the standard input is
      a tty.
      
      This factors out a useful helper "add_head()" from builtin-diff.c to a
      more appropriate place revision.c while renaming it to more descriptive
      name add_head_to_pending(), as that is what the function is about.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3384a2df
  4. 17 11月, 2007 1 次提交
    • L
      Fix rev-list when showing objects involving submodules · 481f0ee6
      Linus Torvalds 提交于
      The function mark_tree_uninteresting() assumed that the tree entries
      are blob when they are not trees.  This is not so.  Since we do
      not traverse into submodules (yet), the gitlinks should be ignored.
      
      In general, we should try to start moving away from using the
      "S_ISLNK()" like things for internal git state. It was a mistake to
      just assume the numbers all were same across all systems in the first
      place.  This implementation converts to the "object_type", and then
      uses a case statement.
      
      Noticed by Ilari on IRC.
      Test script taken from an earlier version by Dscho.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      481f0ee6
  5. 14 11月, 2007 2 次提交
    • L
      Fix parent rewriting in --early-output · 7dc0fe3b
      Linus Torvalds 提交于
      We cannot tell a node that has been checked and found not to be
      interesting (which does not have the TREECHANGE flag) from a
      node that hasn't been checked if it is interesting or not,
      without relying on something else, such as object->parsed.
      
      But an object can get the "parsed" flag for other reasons.
      Which means that "TREECHANGE" has the wrong polarity.
      
      This changes the way how the path pruning logic marks an
      uninteresting commits.  From now on, we consider a commit
      interesting by default, and explicitly mark the ones we decided
      to prune.  The flag is renamed to "TREESAME".
      
      Then, this fixes the logic to show the early output with
      incomplete pruning.  It basically says "a commit that has
      TREESAME set is kind-of-UNINTERESTING", but obviously in a
      different way than an outright UNINTERESTING commit.  Until we
      parse and examine enough parents to determine if a commit
      becomes surely "kind-of-UNINTERESTING", we avoid rewriting
      the ancestry so that later rounds can fix things up.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7dc0fe3b
    • L
      Fix rev-list when showing objects involving submodules · 4d1012c3
      Linus Torvalds 提交于
      The function mark_tree_uninteresting() assumed that the tree entries
      are blob when they are not trees.  This is not so.  Since we do
      not traverse into submodules (yet), the gitlinks should be ignored.
      
      In general, we should try to start moving away from using the
      "S_ISLNK()" like things for internal git state. It was a mistake to
      just assume the numbers all were same across all systems in the first
      place.  This implementation converts to the "object_type", and then
      uses a case statement.
      
      Noticed by Ilari on IRC.
      Test script taken from an earlier version by Dscho.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4d1012c3
  6. 12 11月, 2007 1 次提交
  7. 06 11月, 2007 2 次提交
    • L
      revision walker: mini clean-up · 53b2c823
      Linus Torvalds 提交于
      This removes the unnecessary indirection of "revs->prune_fn",
      since that function is always the same one (or NULL), and there
      is in fact not even an abstraction reason to make it a function
      (i.e. its not called from some other file and doesn't allow us
      to keep the function itself static or anything like that).
      
      It then just replaces it with a bit that says "prune or not",
      and if not pruning, every commit gets TREECHANGE.
      
      That in turn means that
      
       - if (!revs->prune_fn || (flags & TREECHANGE))
       - if (revs->prune_fn && !(flags & TREECHANGE))
      
      just become
      
       - if (flags & TREECHANGE)
       - if (!(flags & TREECHANGE))
      
      respectively.
      
      Together with adding the "single_parent()" helper function, the "complex"
      conditional now becomes
      
      	if (!(flags & TREECHANGE) && rev->dense && single_parent(commit))
      		continue;
      
      Also indirection of "revs->dense" checking is thrown away the
      same way, because TREECHANGE bit is set appropriately now.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      53b2c823
    • L
      Enhance --early-output format · 252a7c02
      Linus Torvalds 提交于
      This makes --early-output a bit more advanced, and actually makes it
      generate multiple "Final output:" headers as it updates things
      asynchronously. I realize that the "Final output:" line is now illogical,
      since it's not really final until it also says "done", but
      
      It now _always_ generates a "Final output:" header in front of any commit
      list, and that output header gives you a *guess* at the maximum number of
      commits available. However, it should be noted that the guess can be
      completely off: I do a reasonable job estimating it, but it is not meant
      to be exact.
      
      So what happens is that you may get output like this:
      
       - at 0.1 seconds:
      
      	Final output: 2 incomplete
      	.. 2 commits listed ..
      
       - half a second later:
      
      	Final output: 33 incomplete
      	.. 33 commits listed ..
      
       - another half a second after that:
      
      	Final output: 71 incomplete
      	.. 71 commits listed ..
      
       - another half second later:
      
      	Final output: 136 incomplete
      	.. 100 commits listed: we hit the --early-output limit, and
      	.. will only output 100 commits, and after this you'll not
      	.. see an "incomplete" report any more since you got as much
      	.. early output as you asked for!
      
       - .. and then finally:
      
      	Final output: 73106 done
      	.. all the commits ..
      
      The above is a real-life scenario on my current kernel tree after having
      flushed all the caches.
      
      Tested with the experimental gitk patch that Paul sent out, and by looking
      at the actual log output (and verifying that my commit count guesses
      actually match real life fairly well).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      252a7c02
  8. 04 11月, 2007 2 次提交
    • L
      Add "--early-output" log flag for interactive GUI use · cdcefbc9
      Linus Torvalds 提交于
      This adds support for "--early-output[=n]" as a flag to the "git log"
      family of commands.  This allows GUI programs to state that they want to
      get some output early, in order to be able to show at least something
      quickly, even if the full output may take longer to generate.
      
      If no count is specified, a default count of a hundred commits will be
      used, although the actual numbr of commits output may be smaller
      depending on how many commits were actually found in the first tenth of
      a second (or if *everything* was found before that, in which case no
      early output will be provided, and only the final list is made
      available).
      
      When the full list is generated, there will be a "Final output:" string
      prepended to it, regardless of whether any early commits were shown or
      not, so that the consumer can always know the difference between early
      output and the final list.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cdcefbc9
    • L
      Simplify topo-sort logic · 23c17d4a
      Linus Torvalds 提交于
      .. by not using quite so much indirection.
      
      This currently grows the "struct commit" a bit, which could be avoided by
      using a union for "util" and "indegree" (the topo-sort used to use "util"
      anyway, so you cannot use them together), but for now the goal of this was
      to simplify, not optimize.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      23c17d4a
  9. 16 10月, 2007 1 次提交
    • L
      Fix embarrassing "git log --follow" bug · 99516e35
      Linus Torvalds 提交于
      It turns out that I completely broke "git log --follow" with my recent
      patch to revision.c ("Fix revision log diff setup, avoid unnecessary diff
      generation", commit b7bb760d).
      
      Why? Because --follow obviously requires the diff machinery to function,
      exactly the same way pickaxe does.
      
      So everybody is away right now, but considering that nobody even noticed
      this bug, I don't think it matters. But for the record, here's the trivial
      one-liner fix (well, two, since I also fixed the comment).
      
      Because of the nature of the bug, if you ask for patches when following
      (which is one of the things I normally do), the bug is hidden, because
      then the request for diff output will automatically also enable the diffs
      themselves.
      
      So while "git log --follow <filename>" didn't work, adding a "-p"
      magically made it work again even without this fix.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NLars Hjemli <hjemli@gmail.com>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      99516e35
  10. 30 9月, 2007 2 次提交
    • A
      parse_date_format(): convert a format name to an enum date_mode · 856665f8
      Andy Parkins 提交于
      Factor out the code to parse --date=<format> parameter to revision
      walkers into a separate function, parse_date_format().  This function
      is passed a string and converts it to an enum date_format:
      
       - "relative"         => DATE_RELATIVE
       - "iso8601" or "iso" => DATE_ISO8601
       - "rfc2822"          => DATE_RFC2822
       - "short"            => DATE_SHORT
       - "local"            => DATE_LOCAL
       - "default"          => DATE_NORMAL
      
      In the event that none of these strings is found, the function die()s.
      Signed-off-by: NAndy Parkins <andyparkins@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      856665f8
    • L
      Fix revision log diff setup, avoid unnecessary diff generation · b7bb760d
      Linus Torvalds 提交于
      We used to incorrectly start calculating diffs whenever any argument but
      '-z' was recognized by the diff options parsing. That was bogus, since not
      all arguments result in diffs being needed, so we just waste a lot of time
      and effort on calculating diffs that don't matter.
      
      This actually also fixes another bug in "git log". Try this:
      
      	git log -C
      
      and notice how it prints an extra empty line in between log entries, even
      though it never prints the actual diff (because we didn't ask for any diff
      format, so the diff machinery never prints anything).
      
      With this patch, that bogus empty line is gone, because "revs->diff" is
      never set.  So this isn't just a "wasted time and effort" issue, it's also
      a slight semantic fix.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b7bb760d
  11. 16 9月, 2007 1 次提交
  12. 31 8月, 2007 1 次提交
  13. 20 8月, 2007 1 次提交
    • S
      Don't allow combination of -g and --reverse as it doesn't work · d56651c0
      Shawn O. Pearce 提交于
      The --walk-reflogs logic and the --reverse logic are completely
      incompatible with one another.  Attempting to use both at the same
      time leads to confusing results that sometimes violates the user's
      formatting options or ignores the user's request to see the reflog
      message and timestamp.
      
      Unfortunately the implementation of both of these features is glued
      onto the side of the revision walking machinary in such a way that
      they are probably not going to be easy to make them compatible with
      each other.  Rather than offering the user confusing results we are
      better off bailing out with an error message until such a time as
      the implementations can be refactored to be compatible.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d56651c0
  14. 14 8月, 2007 1 次提交
  15. 25 7月, 2007 1 次提交
  16. 24 7月, 2007 1 次提交
    • J
      Teach revision machinery about --no-walk · 8e64006e
      Johannes Schindelin 提交于
      The flag "no_walk" is present in struct rev_info since a long time, but
      so far has been in use exclusively by "git show".
      
      With this flag, you can see all your refs, ordered by date of the last
      commit:
      
      $ git log --abbrev-commit --pretty=oneline --decorate --all --no-walk
      
      which is extremely helpful if you have to juggle with a lot topic
      branches, and do not remember in which one you introduced that uber
      debug option, or simply want to get an overview what is cooking.
      
      (Note that the "git log" invocation above does not output the same as
      
       $ git show --abbrev-commit --pretty=oneline --decorate --all --quiet
      
       since "git show" keeps the alphabetic order that "--all" returns the
       refs in, even if the option "--date-order" was passed.)
      
      For good measure, this also adds the "--do-walk" option which overrides
      "--no-walk".
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e64006e
  17. 22 7月, 2007 1 次提交
  18. 21 7月, 2007 1 次提交
  19. 14 7月, 2007 1 次提交
  20. 12 7月, 2007 1 次提交
  21. 09 7月, 2007 1 次提交
  22. 03 7月, 2007 1 次提交
  23. 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
  24. 16 6月, 2007 1 次提交
  25. 08 6月, 2007 1 次提交
  26. 21 5月, 2007 1 次提交
  27. 06 5月, 2007 1 次提交
  28. 26 4月, 2007 1 次提交
    • J
      Add --date={local,relative,default} · a7b02ccf
      Junio C Hamano 提交于
      This adds --date={local,relative,default} option to log family of commands,
      to allow displaying timestamps in user's local timezone, relative time, or
      the default format.
      
      Existing --relative-date option is a synonym of --date=relative; we could
      probably deprecate it in the long run.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a7b02ccf
  29. 24 4月, 2007 1 次提交
  30. 13 4月, 2007 1 次提交
  31. 12 4月, 2007 1 次提交
    • J
      git-log --cherry-pick A...B · d7a17cad
      Junio C Hamano 提交于
      This is meant to be a saner replacement for "git-cherry".
      
      When used with "A...B", this filters out commits whose patch
      text has the same patch-id as a commit on the other side.  It
      would probably most useful to use with --left-right.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d7a17cad
  32. 31 3月, 2007 1 次提交
    • T
      Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS · 46efd2d9
      Theodore Ts'o 提交于
      This fixes a problem reported by Randal Schwartz:
      
      >I finally tracked down all the (albeit inconsequential) errors I was getting
      >on both OpenBSD and OSX.  It's the warn() function in usage.c.  There's
      >warn(3) in BSD-style distros.  It'd take a "great rename" to change it, but if
      >someone with better C skills than I have could do that, my linker and I would
      >appreciate it.
      
      It was annoying to me, too, when I was doing some mergetool testing on
      Mac OS X, so here's a fix.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: "Randal L. Schwartz" <merlyn@stonehenge.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      46efd2d9
  33. 22 3月, 2007 1 次提交
  34. 20 3月, 2007 1 次提交
  35. 15 3月, 2007 2 次提交
    • J
      git-log --first-parent: show only the first parent log · 0053e902
      Junio C Hamano 提交于
      If your development history does not have fast-forward merges,
      i.e. the "first parent" of commits in your history are special
      than other parents, this option gives a better overview of the
      evolution of a particular branch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0053e902
    • J
      try-to-simplify-commit: use diff-tree --quiet machinery. · dd47aa31
      Junio C Hamano 提交于
      This uses diff-tree --quiet machinery to terminate the internal
      diff-tree between a commit and its parents via revs.pruning (not
      revs.diffopt) as soon as we find enough about the tree change.
      
      With respect to the optionally given pathspec, we are interested
      if the tree of commit is identical to the parent's, only adds
      new paths to the parent's, or there are other differences.  As
      soon as we find out that there is one such other kind of
      difference, we do not have to compare the rest of the tree.
      
      Because we do not call standard diff_addremove/diff_change, we
      instruct the diff-tree machinery to stop early by setting
      has_changes when we say we found the trees to be different.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dd47aa31