1. 10 8月, 2010 1 次提交
  2. 23 2月, 2010 1 次提交
    • L
      Move 'builtin-*' into a 'builtin/' subdirectory · 81b50f3c
      Linus Torvalds 提交于
      This shrinks the top-level directory a bit, and makes it much more
      pleasant to use auto-completion on the thing. Instead of
      
      	[torvalds@nehalem git]$ em buil<tab>
      	Display all 180 possibilities? (y or n)
      	[torvalds@nehalem git]$ em builtin-sh
      	builtin-shortlog.c     builtin-show-branch.c  builtin-show-ref.c
      	builtin-shortlog.o     builtin-show-branch.o  builtin-show-ref.o
      	[torvalds@nehalem git]$ em builtin-shor<tab>
      	builtin-shortlog.c  builtin-shortlog.o
      	[torvalds@nehalem git]$ em builtin-shortlog.c
      
      you get
      
      	[torvalds@nehalem git]$ em buil<tab>		[type]
      	builtin/   builtin.h
      	[torvalds@nehalem git]$ em builtin		[auto-completes to]
      	[torvalds@nehalem git]$ em builtin/sh<tab>	[type]
      	shortlog.c     shortlog.o     show-branch.c  show-branch.o  show-ref.c     show-ref.o
      	[torvalds@nehalem git]$ em builtin/sho		[auto-completes to]
      	[torvalds@nehalem git]$ em builtin/shor<tab>	[type]
      	shortlog.c  shortlog.o
      	[torvalds@nehalem git]$ em builtin/shortlog.c
      
      which doesn't seem all that different, but not having that annoying
      break in "Display all 180 possibilities?" is quite a relief.
      
      NOTE! If you do this in a clean tree (no object files etc), or using an
      editor that has auto-completion rules that ignores '*.o' files, you
      won't see that annoying 'Display all 180 possibilities?' message - it
      will just show the choices instead.  I think bash has some cut-off
      around 100 choices or something.
      
      So the reason I see this is that I'm using an odd editory, and thus
      don't have the rules to cut down on auto-completion.  But you can
      simulate that by using 'ls' instead, or something similar.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      81b50f3c
  3. 08 8月, 2009 1 次提交
  4. 28 6月, 2009 1 次提交
  5. 08 12月, 2008 2 次提交
    • J
      reorder ALLOW_TEXTCONV option setting · 5ec11af6
      Jeff King 提交于
      Right now for the diff porcelain and the log family, we
      call:
      
        init_revisions();
        setup_revisions();
        DIFF_OPT_SET(ALLOW_TEXTCONV);
      
      However, that means textconv will _always_ be on, instead of
      being a default that can be manipulated with
      setup_revisions. Instead, we want:
      
        init_revisions();
        DIFF_OPT_SET(ALLOW_TEXTCONV);
        setup_revisions();
      
      which is what this patch does.
      
      We'll go ahead and move the callsite in wt-status, also;
      even though the user can't pass any options here, it is a
      cleanup that will help avoid any surprise later if the
      setup_revisions line is changed.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5ec11af6
    • M
      "git diff <tree>{3,}": do not reverse order of arguments · dbc2fb6b
      Matt McCutchen 提交于
      According to the message of commit 0fe7c1de,
      "git diff" with three or more trees expects the merged tree first followed by
      the parents, in order.  However, this command reversed the order of its
      arguments, resulting in confusing diffs.  A comment /* Again, the revs are all
      reverse */ suggested there was a reason for this, but I can't figure out the
      reason, so I removed the reversal of the arguments.  Test case included.
      Signed-off-by: NMatt McCutchen <matt@mattmccutchen.net>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      dbc2fb6b
  6. 27 11月, 2008 1 次提交
    • J
      Teach "git diff" to honour --[no-]ext-diff · 61af494c
      Junio C Hamano 提交于
      The original intention of 72909bef (Add diff-option --ext-diff, 2007-06-30)
      was to optionally allow the use of external diff viewer in "git log"
      family (while keeping them disabled by default).  It exposed the "allow
      external diff" bit to the UI, but forgot to adjust the "git diff" codepath
      that was set up to always allow use of the external diff viewer.
      
      Noticed by Nazri Ramliy; tests by René Scharfe squashed in.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61af494c
  7. 15 11月, 2008 1 次提交
    • L
      Add cache preload facility · 671c9b7e
      Linus Torvalds 提交于
      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: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      671c9b7e
  8. 12 11月, 2008 1 次提交
  9. 27 10月, 2008 1 次提交
    • J
      userdiff: require explicitly allowing textconv · c7534ef4
      Jeff King 提交于
      Diffs that have been produced with textconv almost certainly
      cannot be applied, so we want to be careful not to generate
      them in things like format-patch.
      
      This introduces a new diff options, ALLOW_TEXTCONV, which
      controls this behavior. It is off by default, but is
      explicitly turned on for the "log" family of commands, as
      well as the "diff" porcelain (but not diff-* plumbing).
      
      Because both text conversion and external diffing are
      controlled by these diff options, we can get rid of the
      "plumbing versus porcelain" distinction when reading the
      config. This was an attempt to control the same thing, but
      suffered from being too coarse-grained.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c7534ef4
  10. 13 10月, 2008 1 次提交
  11. 19 9月, 2008 1 次提交
    • J
      diff/diff-files: do not use --cc too aggressively · 903e09a3
      Junio C Hamano 提交于
      Textual diff output for unmerged paths was too eager to give condensed
      combined diff.  Even though "diff -c" (and "diff-files -c -p") is a
      request to view combined diff without condensing (otherwise the user would
      have explicitly asked for --cc, not -c), we showed "--cc" output anyway.
      
      0fe7c1de (built-in diff: assorted updates, 2006-04-29) claimed to be
      careful about doing this, but its breakage was hidden because back then
      "git diff" was still a shell script that did not use the codepath it
      introduced fully.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      903e09a3
  12. 31 8月, 2008 1 次提交
    • J
      diff: vary default prefix depending on what are compared · a5a818ee
      Junio C Hamano 提交于
      With a new configuration "diff.mnemonicprefix", "git diff" shows the
      differences between various combinations of preimage and postimage trees
      with prefixes different from the standard "a/" and "b/".  Hopefully this
      will make the distinction stand out for some people.
      
          "git diff" compares the (i)ndex and the (w)ork tree;
          "git diff HEAD" compares a (c)ommit and the (w)ork tree;
          "git diff --cached" compares a (c)ommit and the (i)ndex;
          "git-diff HEAD:file1 file2" compares an (o)bject and a (w)ork tree entity;
          "git diff --no-index a b" compares two non-git things (1) and (2).
      
      Because these mnemonics now have meanings, they are swapped when reverse
      diff is in effect and this feature is enabled.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a5a818ee
  13. 29 8月, 2008 1 次提交
    • N
      diff*: fix worktree setup · 4f38f6b5
      Nguyễn Thái Ngọc Duy 提交于
      This fixes "git diff", "git diff-files" and "git diff-index" to work
      correctly under worktree setup. Because diff* family works in many modes
      and not all of them require worktree, Junio made a nice summary
      (with a little modification from me):
      
       * diff-files is about comparing with work tree, so it obviously needs a
        work tree;
      
       * diff-index also does, except "diff-index --cached" or "diff --cached TREE"
      
       * no-index is about random files outside git context, so it obviously
         doesn't need any work tree;
      
       * comparing two (or more) trees doesn't;
      
       * comparing two blobs doesn't;
      
       * comparing a blob with a random file doesn't;
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4f38f6b5
  14. 24 7月, 2008 1 次提交
  15. 14 7月, 2008 1 次提交
    • S
      Make usage strings dash-less · 1b1dd23f
      Stephan Beyer 提交于
      When you misuse a git command, you are shown the usage string.
      But this is currently shown in the dashed form.  So if you just
      copy what you see, it will not work, when the dashed form
      is no longer supported.
      
      This patch makes git commands show the dash-less version.
      
      For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
      generates a dash-less usage string now.
      Signed-off-by: NStephan Beyer <s-beyer@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1b1dd23f
  16. 24 5月, 2008 1 次提交
    • J
      "git diff": do not ignore index without --no-index · 0569e9b8
      Junio C Hamano 提交于
      Even if "foo" and/or "bar" does not exist in index, "git diff foo bar"
      should not change behaviour drastically from "git diff foo bar baz" or
      "git diff foo".  A feature that "sometimes works and is handy" is an
      unreliable cute hack.
      
      "git diff foo bar" outside a git repository continues to work as a more
      colourful alternative to "diff -u" as before.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0569e9b8
  17. 15 5月, 2008 1 次提交
  18. 27 3月, 2008 1 次提交
  19. 18 2月, 2008 1 次提交
  20. 14 2月, 2008 1 次提交
    • 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
  21. 17 1月, 2008 1 次提交
  22. 14 12月, 2007 2 次提交
    • J
      diff --check: minor fixups · da31b358
      Junio C Hamano 提交于
      There is no reason --exit-code and --check-diff must be mutually
      exclusive, so assign different bits to different results and allow them
      to be returned from the command.  Introduce diff_result_code() to factor
      out the common code to decide final status code based on diffopt
      settings and use it everywhere.
      
      Update tests to match the above fix.
      
      Turning pager off when "diff --check" is used is a regression.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      da31b358
    • W
      "diff --check" should affect exit status · 62c64895
      Wincent Colaiuta 提交于
      "git diff" has a --check option that can be used to check for whitespace
      problems but it only reported by printing warnings to the
      console.
      
      Now when the --check option is used we give a non-zero exit status,
      making "git diff --check" nicer to use in scripts and hooks.
      Signed-off-by: NWincent Colaiuta <win@wincent.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      62c64895
  23. 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
  24. 12 11月, 2007 1 次提交
  25. 09 11月, 2007 1 次提交
    • J
      refresh_index_quietly(): express "optional" nature of index writing better · fbbdbfc3
      Junio C Hamano 提交于
      The point of the part of the code this patch touches is that if
      we modified the active_cache, we try to write it out and make it
      the index file for later users to use by calling
      "commit_locked_index", but we do not really care about the
      failure from this sequence because it is done purely as an
      optimization.
      
      The original code called three functions primarily for their
      side effects but as condition of an if statement, which is
      admittedly a bad style.
      
      Incidentally, it squelches an "empty if body" warning from gcc.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fbbdbfc3
  26. 01 9月, 2007 1 次提交
    • J
      git-diff: resurrect the traditional empty "diff --git" behaviour · aecbf914
      Junio C Hamano 提交于
      The warning message to suggest "Consider running git-status" from
      "git-diff" that we experimented with during the 1.5.3 cycle turns
      out to be a bad idea.  It robbed cache-dirty information from people
      who valued it, while still asking users to run "update-index --refresh".
      It was hoped that the new behaviour would at least have some educational
      value, but not showing the cache-dirty paths like before meant that the
      user would not even know easily which paths were cache-dirty, and it
      made the need to refresh the index look like even more unnecessary chore.
      
      This commit reinstates the traditional behaviour, but with a twist.
      
      By default, the empty "diff --git" output is totally squelched out
      from "git diff" output.  At the end of the command, it automatically
      runs "update-index --refresh" as needed, without even bothering the
      user.  In other words, people who do not care about the cache-dirtyness
      do not even have to see the warning.
      
      The traditional behaviour to see the stat-dirty output and to bypassing
      the overhead of content comparison can be specified by setting the
      configuration variable diff.autorefreshindex to false.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      aecbf914
  27. 14 8月, 2007 2 次提交
    • J
      git-diff: squelch "empty" diffs · fb13227e
      Junio C Hamano 提交于
      After starting to edit a working tree file but later when your edit ends
      up identical to the original (this can also happen when you ran a
      wholesale regexp replace with something like "perl -i" that does not
      actually modify many of the paths), "git diff" between the index and the
      working tree outputs many "empty" diffs that show "diff --git" headers
      and nothing else, because these paths are stat-dirty.  While it was a
      way to warn the user that the earlier action of the user made the index
      ineffective as an optimization mechanism, it was felt too loud for the
      purpose of warning even to experienced users, and also resulted in
      confusing people new to git.
      
      This replaces the "empty" diffs with a single warning message at the
      end.  Having many such paths hurts performance, and you can run
      "git-update-index --refresh" to update the lstat(2) information recorded
      in the index in such a case.  "git-status" does so as a side effect, and
      that is more familiar to the end-user, so we recommend it to them.
      
      The change affects only "git diff" that outputs patch text, because that
      is where the annoyance of too many "empty" diff is most strongly felt,
      and because the warning message can be safely ignored by downstream
      tools without getting mistaken as part of the patch.  For the low-level
      "git diff-files" and "git diff-index", the traditional behaviour is
      retained.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fb13227e
    • R
      diff: don't run pager if user asked for a diff style exit code · 89d07f75
      René Scharfe 提交于
      As Wincent Colaiuta found out, it's a bit unexpected for git diff to
      start a pager even when the --quiet option is specified.  The problem
      is that the pager hides the return code -- which is the only output
      we're interested in in this case.
      
      Push pager setup down into builtin-diff.c and don't start the pager
      if --exit-code or --quiet (which implies --exit-code) was specified.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      89d07f75
  28. 30 7月, 2007 1 次提交
    • J
      git-diff: turn on recursion by default · 82cb8afa
      Jeff King 提交于
      The tree recursion behavior of git-diff may appear
      inconsistent to the user because it depends on the format of
      the patch as well as whether one is diffing between trees or
      against the index.
      
      Since git-diff is a porcelain wrapper for low-level diff
      commands, it makes sense for its behavior to be consistent
      no matter what is being diffed.  This patch turns on
      recursion in all cases.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      82cb8afa
  29. 24 4月, 2007 2 次提交
  30. 23 4月, 2007 1 次提交
    • J
      Support 'diff=pgm' attribute · f1af60bd
      Junio C Hamano 提交于
      This enhances the attributes mechanism so that external programs
      meant for existing GIT_EXTERNAL_DIFF interface can be specifed
      per path.
      
      To configure such a custom diff driver, first define a custom
      diff driver in the configuration:
      
      	[diff "my-c-diff"]
      		command = <<your command string comes here>>
      
      Then mark the paths that you want to use this custom driver
      using the attribute mechanism.
      
      	*.c	diff=my-c-diff
      
      The intent of this separation is that the attribute mechanism is
      used for specifying the type of the contents, while the
      configuration mechanism is used to define what needs to be done
      to that type of the contents, which would be specific to both
      platform and personal taste.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f1af60bd
  31. 15 3月, 2007 1 次提交
  32. 01 3月, 2007 1 次提交
  33. 26 2月, 2007 1 次提交
  34. 23 2月, 2007 2 次提交
  35. 22 2月, 2007 1 次提交