1. 10 7月, 2008 1 次提交
  2. 09 7月, 2008 1 次提交
  3. 26 5月, 2008 5 次提交
  4. 13 5月, 2008 1 次提交
  5. 06 5月, 2008 2 次提交
  6. 30 4月, 2008 1 次提交
    • S
      Simplify and fix --first-parent implementation · d9c292e8
      Stephen R. van den Berg 提交于
      The purpose of --first-parent is to view the tree without looking at
      side branche.  This is accomplished by pretending there are no other
      parents than the first parent when encountering a merge.
      
      The current code marks the other parents as seen, which means that the tree
      traversal will behave differently depending on the order merges are handled.
      
      When a fast forward is artificially recorded as a merge,
      
             -----
            /     \
       D---E---F---G master
      
      the current first-parent code considers E to be seen and stops the
      traversal after showing G and F.
      Signed-off-by: NStephen R. van den Berg <srb@cuci.nl>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d9c292e8
  7. 13 4月, 2008 1 次提交
  8. 12 4月, 2008 1 次提交
  9. 10 4月, 2008 1 次提交
    • J
      log: teach "terminator" vs "separator" mode to "--pretty=format" · 4da45bef
      Junio C Hamano 提交于
      This attached patch introduces a single bit "use_terminator" in "struct
      rev_info", which is normally false (i.e. most formats use separator
      semantics) but by flipping it to true, you can ask for terminator
      semantics just like oneline format does.
      
      The function get_commit_format(), which is what parses "--pretty=" option,
      now takes a pointer to "struct rev_info" and updates its commit_format and
      use_terminator fields.  It used to return the value of type "enum
      cmit_fmt", but all the callers assigned it to rev->commit_format.
      
      There are only two cases the code turns use_terminator on.  Obviously, the
      traditional oneline format (--pretty=oneline) is one of them, and the new
      case is --pretty=tformat:... that acts like --pretty=format:... but flips
      the bit on.
      
      With this, "--pretty=tformat:%H %s" acts like --pretty=oneline.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4da45bef
  10. 19 3月, 2008 1 次提交
    • L
      Make revision limiting more robust against occasional bad commit dates · 7d004199
      Linus Torvalds 提交于
      The revision limiter uses the commit date to decide when it has seen
      enough commits to finalize the revision list, but that can get confused
      if there are incorrect dates far in the past on some commits.
      
      This makes the logic a bit more robust by
      
       - we always walk an extra SLOP commits from the source list even if we
         decide that the source list is probably all done (unless the source is
         entirely empty, of course, because then we really can't do anything at
         all)
      
       - we keep track of the date of the last commit we added to the
         destination list (this will *generally* be the oldest entry we've seen
         so far)
      
       - we compare that with the youngest entry (the first one) of the source
         list, and if the destination is older than the source, we know we want
         to look at the source.
      
      which causes occasional date mishaps to be handled cleanly.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7d004199
  11. 29 2月, 2008 1 次提交
  12. 28 2月, 2008 1 次提交
  13. 27 2月, 2008 1 次提交
  14. 19 2月, 2008 2 次提交
  15. 14 2月, 2008 3 次提交
    • L
      Add "--show-all" revision walker flag for debugging · 3131b713
      Linus Torvalds 提交于
      It's really not very easy to visualize the commit walker, because - on
      purpose - it obvously doesn't show the uninteresting commits!
      
      This adds a "--show-all" flag to the revision walker, which will make
      it show uninteresting commits too, and they'll have a '^' in front of
      them (it also fixes a logic error for !verbose_header for boundary
      commits - we should show the '-' even if left_right isn't shown).
      
      A separate patch to gitk to teach it the new '^' was sent
      to paulus.  With the change in place, it actually is interesting
      even for the cases that git doesn't have any problems with, ie
      for the kernel you can do:
      
      	gitk -d --show-all v2.6.24..
      
      and you see just how far down it has to parse things to see it all. The
      use of "-d" is a good idea, since the date-ordered toposort is much better
      at showing why it goes deep down (ie the date of some of those commits
      after 2.6.24 is much older, because they were merged from trees that
      weren't rebased).
      
      So I think this is a useful feature even for non-debugging - just to
      visualize what git does internally more.
      
      When it actually breaks out due to the "everybody_uninteresting()"
      case, it adds the uninteresting commits (both the one it's looking at
      now, and the list of pending ones) to the list
      
      This way, we really list *all* the commits we've looked at.
      
      Because we now end up listing commits we may not even have been parsed
      at all "show_log" and "show_commit" need to protect against commits
      that don't have a commit buffer entry.
      
      That second part is debatable just how it should work. Maybe we shouldn't
      show such entries at all (with this patch those entries do get shown, they
      just don't get any message shown with them). But I think this is a useful
      case.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3131b713
    • J
      diff --relative: help working in a bare repository · c0cb4a06
      Junio C Hamano 提交于
      This allows the --relative option to say which subdirectory to
      pretend to be in, so that in a bare repository, you can say:
      
          $ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c0cb4a06
    • J
      diff --relative: output paths as relative to the current subdirectory · cd676a51
      Junio C Hamano 提交于
      This adds --relative option to the diff family.  When you start
      from a subdirectory:
      
              $ git diff --relative
      
      shows only the diff that is inside your current subdirectory,
      and without $prefix part.  People who usually live in
      subdirectories may like it.
      
      There are a few things I should also mention about the change:
      
       - This works not just with diff but also works with the log
         family of commands, but the history pruning is not affected.
      
         In other words, if you go to a subdirectory, you can say:
      
              $ git log --relative -p
      
         but it will show the log message even for commits that do not
         touch the current directory.  You can limit it by giving
         pathspec yourself:
      
              $ git log --relative -p .
      
         This originally was not a conscious design choice, but we
         have a way to affect diff pathspec and pruning pathspec
         independently.  IOW "git log --full-diff -p ." tells it to
         prune history to commits that affect the current subdirectory
         but show the changes with full context.  I think it makes
         more sense to leave pruning independent from --relative than
         the obvious alternative of always pruning with the current
         subdirectory, which would break the symmetry.
      
       - Because this works also with the log family, you could
         format-patch a single change, limiting the effect to your
         subdirectory, like so:
      
              $ cd gitk-git
              $ git format-patch -1 --relative 911f1eb
      
         But because that is a special purpose usage, this option will
         never become the default, with or without repository or user
         preference configuration.  The risk of producing a partial
         patch and sending it out by mistake is too great if we did
         so.
      
       - This is inherently incompatible with --no-index, which is a
         bolted-on hack that does not have much to do with git
         itself.  I didn't bother checking and erroring out on the
         combined use of the options, but probably I should.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      cd676a51
  16. 27 12月, 2007 1 次提交
  17. 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
  18. 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
  19. 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
  20. 12 11月, 2007 1 次提交
  21. 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
  22. 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
  23. 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
  24. 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
  25. 16 9月, 2007 1 次提交
  26. 31 8月, 2007 1 次提交
  27. 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
  28. 14 8月, 2007 1 次提交