1. 30 6月, 2018 1 次提交
  2. 15 2月, 2018 1 次提交
  3. 07 12月, 2017 1 次提交
    • B
      diff-tree: read the index so attribute checks work in bare repositories · fd66bcc3
      Brandon Williams 提交于
      A regression was introduced in 557a5998 (submodule: remove
      gitmodules_config, 2017-08-03) to how attribute processing was handled
      in bare repositories when running the diff-tree command.
      
      By default the attribute system will first try to read ".gitattribute"
      files from the working tree and then falls back to reading them from the
      index if there isn't a copy checked out in the worktree.  Prior to
      557a5998 the index was read as a side effect of the call to
      'gitmodules_config()' which ensured that the index was already populated
      before entering the attribute subsystem.
      
      Since the call to 'gitmodules_config()' was removed the index is no
      longer being read so when the attribute system tries to read from the
      in-memory index it doesn't find any ".gitattribute" entries effectively
      ignoring any configured attributes.
      
      Fix this by explicitly reading the index during the setup of diff-tree.
      Reported-by: NBen Boeckel <ben.boeckel@kitware.com>
      Signed-off-by: NBrandon Williams <bmwill@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fd66bcc3
  4. 04 8月, 2017 1 次提交
  5. 16 6月, 2017 1 次提交
  6. 05 6月, 2017 3 次提交
  7. 02 6月, 2017 1 次提交
  8. 09 5月, 2017 1 次提交
  9. 08 5月, 2017 3 次提交
    • B
      object: convert parse_object* to take struct object_id · c251c83d
      brian m. carlson 提交于
      Make parse_object, parse_object_or_die, and parse_object_buffer take a
      pointer to struct object_id.  Remove the temporary variables inserted
      earlier, since they are no longer necessary.  Transform all of the
      callers using the following semantic patch:
      
      @@
      expression E1;
      @@
      - parse_object(E1.hash)
      + parse_object(&E1)
      
      @@
      expression E1;
      @@
      - parse_object(E1->hash)
      + parse_object(E1)
      
      @@
      expression E1, E2;
      @@
      - parse_object_or_die(E1.hash, E2)
      + parse_object_or_die(&E1, E2)
      
      @@
      expression E1, E2;
      @@
      - parse_object_or_die(E1->hash, E2)
      + parse_object_or_die(E1, E2)
      
      @@
      expression E1, E2, E3, E4, E5;
      @@
      - parse_object_buffer(E1.hash, E2, E3, E4, E5)
      + parse_object_buffer(&E1, E2, E3, E4, E5)
      
      @@
      expression E1, E2, E3, E4, E5;
      @@
      - parse_object_buffer(E1->hash, E2, E3, E4, E5)
      + parse_object_buffer(E1, E2, E3, E4, E5)
      Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c251c83d
    • B
      Convert lookup_tree to struct object_id · 740ee055
      brian m. carlson 提交于
      Convert the lookup_tree function to take a pointer to struct object_id.
      
      The commit was created with manual changes to tree.c, tree.h, and
      object.c, plus the following semantic patch:
      
      @@
      @@
      - lookup_tree(EMPTY_TREE_SHA1_BIN)
      + lookup_tree(&empty_tree_oid)
      
      @@
      expression E1;
      @@
      - lookup_tree(E1.hash)
      + lookup_tree(&E1)
      
      @@
      expression E1;
      @@
      - lookup_tree(E1->hash)
      + lookup_tree(E1)
      Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      740ee055
    • B
      Convert lookup_commit* to struct object_id · bc83266a
      brian m. carlson 提交于
      Convert lookup_commit, lookup_commit_or_die,
      lookup_commit_reference, and lookup_commit_reference_gently to take
      struct object_id arguments.
      
      Introduce a temporary in parse_object buffer in order to convert this
      function.  This is required since in order to convert parse_object and
      parse_object_buffer, lookup_commit_reference_gently and
      lookup_commit_or_die would need to be converted.  Not introducing a
      temporary would therefore require that lookup_commit_or_die take a
      struct object_id *, but lookup_commit would take unsigned char *,
      leaving a confusing and hard-to-use interface.
      
      parse_object_buffer will lose this temporary in a later patch.
      
      This commit was created with manual changes to commit.c, commit.h, and
      object.c, plus the following semantic patch:
      
      @@
      expression E1, E2;
      @@
      - lookup_commit_reference_gently(E1.hash, E2)
      + lookup_commit_reference_gently(&E1, E2)
      
      @@
      expression E1, E2;
      @@
      - lookup_commit_reference_gently(E1->hash, E2)
      + lookup_commit_reference_gently(E1, E2)
      
      @@
      expression E1;
      @@
      - lookup_commit_reference(E1.hash)
      + lookup_commit_reference(&E1)
      
      @@
      expression E1;
      @@
      - lookup_commit_reference(E1->hash)
      + lookup_commit_reference(E1)
      
      @@
      expression E1;
      @@
      - lookup_commit(E1.hash)
      + lookup_commit(&E1)
      
      @@
      expression E1;
      @@
      - lookup_commit(E1->hash)
      + lookup_commit(E1)
      
      @@
      expression E1, E2;
      @@
      - lookup_commit_or_die(E1.hash, E2)
      + lookup_commit_or_die(&E1, E2)
      
      @@
      expression E1, E2;
      @@
      - lookup_commit_or_die(E1->hash, E2)
      + lookup_commit_or_die(E1, E2)
      Signed-off-by: Nbrian m. carlson <sandals@crustytoothpaste.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bc83266a
  10. 23 2月, 2017 1 次提交
  11. 31 1月, 2017 1 次提交
    • R
      use SWAP macro · 35d803bc
      René Scharfe 提交于
      Apply the semantic patch swap.cocci to convert hand-rolled swaps to use
      the macro SWAP.  The resulting code is shorter and easier to read, the
      object code is effectively unchanged.
      
      The patch for object.c had to be hand-edited in order to preserve the
      comment before the change; Coccinelle tried to eat it for some reason.
      Signed-off-by: NRene Scharfe <l.s.r@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      35d803bc
  12. 14 5月, 2016 1 次提交
    • A
      diff: run arguments through precompose_argv · 90a78b83
      Alexander Rinass 提交于
      When running diff commands, a pathspec containing decomposed
      unicode code points is not converted to precomposed unicode form
      under Mac OS X, but we normalize the paths in the index and the
      history to precomposed form on that platform.  As a result, the
      pathspec would not match and no diff is shown.
      
      Unlike many builtin commands, the "diff" family of commands do
      not use parse_options(), which is how other builtin commands
      indirectly call precompose_argv() to normalize argv[] into
      precomposed form on Mac OSX.  Teach these commands to call
      precompose_argv() themselves.
      
      Note that precomopose_argv() normalizes not just paths but all
      command line arguments, so things like "git diff -G $string"
      when $string has the decomposed form would first be normalized
      into the precomposed form and would stop hitting the same string
      in the decomposed form in the diff output with this change.
      
      It is not a problem per-se, as "log" family of commands already use
      parse_options() and call precompose_argv()--we can think of this
      change as making the "diff" family of commands behave in a similar
      way as the commands in the "log" family.
      Signed-off-by: NAlexander Rinass <alex@fournova.com>
      Helped-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      90a78b83
  13. 20 11月, 2015 3 次提交
  14. 15 1月, 2015 1 次提交
  15. 29 7月, 2014 1 次提交
    • J
      diff-tree: avoid lookup_unknown_object · b794ebea
      Jeff King 提交于
      We generally want to avoid lookup_unknown_object, because it
      results in allocating more memory for the object than may be
      strictly necessary.
      
      In this case, it is used to check whether we have an
      already-parsed object before calling parse_object, to save
      us from reading the object from disk. Using lookup_object
      would be fine for that purpose, but we can take it a step
      further. Since this code was written, parse_object already
      learned the "check lookup_object" optimization, so we can
      simply call parse_object directly.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b794ebea
  16. 14 7月, 2014 1 次提交
    • J
      diff-tree: avoid lookup_unknown_object · fa960826
      Jeff King 提交于
      We generally want to avoid lookup_unknown_object, because it
      results in allocating more memory for the object than may be
      strictly necessary.
      
      In this case, it is used to check whether we have an
      already-parsed object before calling parse_object, to save
      us from reading the object from disk. Using lookup_object
      would be fine for that purpose, but we can take it a step
      further. Since this code was written, parse_object already
      learned the "check lookup_object" optimization, so we can
      simply call parse_object directly.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fa960826
  17. 09 7月, 2014 1 次提交
  18. 23 3月, 2011 1 次提交
  19. 10 8月, 2010 1 次提交
  20. 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
  21. 21 11月, 2009 1 次提交
    • J
      Teach --stdin option to "log" family · 8b3dce56
      Junio C Hamano 提交于
      Move the logic to read revs from standard input that rev-list knows about
      from it to revision machinery, so that all the users of setup_revisions()
      can feed the list of revs from the standard input when "--stdin" is used
      on the command line.
      
      Allow some users of the revision machinery that want different semantics
      from the "--stdin" option to disable it by setting an option in the
      rev_info structure.
      
      This also cleans up the kludge made to bundle.c via cut and paste.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b3dce56
  22. 15 3月, 2009 1 次提交
    • B
      Remove unused assignments · 8e76bf3f
      Benjamin Kramer 提交于
      These variables were always overwritten or the assigned
      value was unused:
      
        builtin-diff-tree.c::cmd_diff_tree(): nr_sha1
        builtin-for-each-ref.c::opt_parse_sort(): sort_tail
        builtin-mailinfo.c::decode_header_bq(): in
        builtin-shortlog.c::insert_one_record(): len
        connect.c::git_connect(): path
        imap-send.c::v_issue_imap_cmd(): n
        pretty.c::pp_user_info(): filler
        remote::parse_refspec_internal(): llen
      Signed-off-by: NBenjamin Kramer <benny.kra@googlemail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e76bf3f
  23. 11 9月, 2008 1 次提交
  24. 11 8月, 2008 2 次提交
    • K
      Teach git diff-tree --stdin to diff trees · 140b378d
      Karl Hasselström 提交于
      When feeding trees on the command line, you can give exactly two
      trees, not three nor one; --stdin now supports this "two tree" form on
      its input, in addition to accepting lines with one or more commits.
      
      When diffing trees (either specified on the command line or from the
      standard input), the -s, -v, --pretty, --abbrev-commit, --encoding,
      --no-commit-id, and --always options are ignored, since they do not
      apply to trees; and the -m, -c, and --cc options are ignored since
      they would be meaningful only with three or more trees, which is not
      supported (yet).
      Signed-off-by: NKarl Hasselström <kha@treskal.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      140b378d
    • K
      Refactoring: Split up diff_tree_stdin · a57114c8
      Karl Hasselström 提交于
      Into a first half that determines what operation to do, and a second
      half that does it.
      
      Currently the only operation is diffing one or more commits, but a
      later patch will add diffing of trees, at which point this refactoring
      will pay off.
      Signed-off-by: NKarl Hasselström <kha@treskal.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a57114c8
  25. 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
  26. 15 5月, 2008 1 次提交
  27. 05 1月, 2008 1 次提交
    • J
      add a "basic" diff config callback · 9a1805a8
      Jeff King 提交于
      The diff porcelain uses git_diff_ui_config to set
      porcelain-ish config options, like automatically turning on
      color. The plumbing specifically avoids calling this
      function, since it doesn't want things like automatic color
      or rename detection.
      
      However, some diff options should be set for both plumbing
      and porcelain. For example, one can still turn on color in
      git-diff-files using the --color command line option. This
      means we want the color config from color.diff.* (so that
      once color is on, we use the user's preferred scheme), but
      _not_ the color.diff variable.
      
      We split the diff config into "ui" and "basic", where
      "basic" is suitable for use by plumbing (so _most_ things
      affecting the output should still go into the "ui" part).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9a1805a8
  28. 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
  29. 12 11月, 2007 1 次提交
  30. 15 3月, 2007 1 次提交
  31. 29 7月, 2006 2 次提交