1. 13 2月, 2013 1 次提交
  2. 05 9月, 2012 1 次提交
  3. 21 8月, 2012 1 次提交
  4. 10 7月, 2012 1 次提交
  5. 06 6月, 2012 1 次提交
  6. 08 2月, 2012 1 次提交
    • J
      add -e: do not show difference in a submodule that is merely dirty · 701825de
      Johannes Schindelin 提交于
      When the HEAD of the submodule matches what is recorded in the index of
      the superproject, and it has local changes or untracked files, the patch
      offered by "git add -e" for editing shows a diff like this:
      
          diff --git a/submodule b/submodule
          <header>
          -deadbeef...
          +deadbeef...-dirty
      
      Because applying such a patch has no effect to the index, this is a
      useless noise.  Generate the patch with IGNORE_DIRTY_SUBMODULES flag to
      prevent such a change from getting reported.
      
      This patch also loses the "-dirty" suffix from the output when the HEAD of
      the submodule is different from what is in the index of the superproject.
      As such dirtiness expressed by the suffix does not affect the result of
      the patch application at all, there is no information lost if we remove
      it. The user could still run "git status" before "git add -e" if s/he
      cares about the dirtiness.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      701825de
  7. 02 12月, 2011 1 次提交
  8. 15 5月, 2011 1 次提交
  9. 10 5月, 2011 1 次提交
  10. 24 4月, 2011 1 次提交
    • J
      Fix "add -u" that sometimes fails to resolve unmerged paths · 75973b2c
      Junio C Hamano 提交于
      "git add -u" updates the index with the updated contents from the working
      tree by internally running "diff-files" to grab the set of paths that are
      different from the index. Then it updates the index entries for the paths
      that are modified in the working tree, and deletes the index entries for
      the paths that are deleted in the working tree.
      
      It ignored the output from the diff-files that indicated that a path is
      unmerged.  For these paths, it instead relied on the fact that an unmerged
      path is followed by the result of comparison between stage #2 (ours) and
      the working tree, and used that to update or delete such a path when it is
      used to record the resolution of a conflict.
      
      As the result, when a path did not have stage #2 (e.g. "we deleted while
      the other side added"), these unmerged stages were left behind, instead of
      recording what the user resolved in the working tree.
      
      Since we recently fixed "diff-files" to indicate if the corresponding path
      exists on the working tree for an unmerged path, we do not have to rely on
      the comparison with stage #2 anymore. We can instead tell the diff-files
      not to compare with higher stages, and use the unmerged output to update
      the index to reflect the state of the working tree.
      
      The changes to the test vector in t2200 illustrates the nature of the bug
      and the fix.  The test expected stage #1 and #3 entries be left behind,
      but it was codifying the buggy behaviour.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75973b2c
  11. 17 3月, 2011 1 次提交
    • J
      standardize brace placement in struct definitions · 9cba13ca
      Jonathan Nieder 提交于
      In a struct definitions, unlike functions, the prevailing style is for
      the opening brace to go on the same line as the struct name, like so:
      
       struct foo {
      	int bar;
      	char *baz;
       };
      
      Indeed, grepping for 'struct [a-z_]* {$' yields about 5 times as many
      matches as 'struct [a-z_]*$'.
      
      Linus sayeth:
      
       Heretic people all over the world have claimed that this inconsistency
       is ...  well ...  inconsistent, but all right-thinking people know that
       (a) K&R are _right_ and (b) K&R are right.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9cba13ca
  12. 10 3月, 2011 5 次提交
  13. 28 2月, 2011 1 次提交
  14. 16 2月, 2011 1 次提交
  15. 04 2月, 2011 1 次提交
  16. 16 11月, 2010 3 次提交
  17. 13 11月, 2010 1 次提交
    • N
      add: do not rely on dtype being NULL behavior · 0188f6b3
      Nguyễn Thái Ngọc Duy 提交于
      Commit c84de707 (excluded_1(): support exclude files in index -
      2009-08-20) added support for excluded() where dtype can be NULL. It
      was designed specifically for index matching because there was no
      other way to extract dtype information from index. It did not support
      wildcard matching (for example, "a*/" pattern would fail to match).
      
      The code was probably misread when commit 108da0db (git add: Add the
      "--ignore-missing" option for the dry run - 2010-07-10) was made
      because DT_UNKNOWN happens to be zero (NULL) too.
      
      Do not pass DT_UNKNOWN/NULL to excluded(), instead pass a pointer to a
      variable that contains DT_UNKNOWN. The real dtype will be extracted
      from worktree by excluded(), as expected.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0188f6b3
  18. 13 7月, 2010 1 次提交
  19. 01 6月, 2010 1 次提交
    • G
      Rewrite dynamic structure initializations to runtime assignment · 66dbfd55
      Gary V. Vaughan 提交于
      Unfortunately, there are still plenty of production systems with
      vendor compilers that choke unless all compound declarations can be
      determined statically at compile time, for example hpux10.20 (I can
      provide a comprehensive list of our supported platforms that exhibit
      this problem if necessary).
      
      This patch simply breaks apart any compound declarations with dynamic
      initialisation expressions, and moves the initialisation until after
      the last declaration in the same block, in all the places necessary to
      have the offending compilers accept the code.
      Signed-off-by: NGary V. Vaughan <gary@thewrittenword.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      66dbfd55
  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. 17 2月, 2010 1 次提交
  22. 22 1月, 2010 1 次提交
    • L
      Remove diff machinery dependency from read-cache · fb7d3f32
      Linus Torvalds 提交于
      Exal Sibeaz pointed out that some git files are way too big, and that
      add_files_to_cache() brings in all the diff machinery to any git binary
      that needs the basic git SHA1 object operations from read-cache.c. Which
      is pretty much all of them.
      
      It's doubly silly, since add_files_to_cache() is only used by builtin
      programs (add, checkout and commit), so it's fairly easily fixed by just
      moving the thing to builtin-add.c, and avoiding the dependency entirely.
      
      I initially argued to Exal that it would probably be best to try to depend
      on smart compilers and linkers, but after spending some time trying to
      make -ffunction-sections work and giving up, I think Exal was right, and
      the fix is to just do some trivial cleanups like this.
      
      This trivial cleanup results in pretty stunning file size differences.
      The diff machinery really is mostly used by just the builtin programs, and
      you have things like these trivial before-and-after numbers:
      
        -rwxr-xr-x 1 torvalds torvalds 1727420 2010-01-21 10:53 git-hash-object
        -rwxrwxr-x 1 torvalds torvalds  940265 2010-01-21 11:16 git-hash-object
      
      Now, I'm not saying that 940kB is good either, but that's mostly all the
      debug information - you can see the real code with 'size':
      
         text	   data	    bss	    dec	    hex	filename
       418675	   3920	 127408	 550003	  86473	git-hash-object (before)
       230650	   2288	 111728	 344666	  5425a	git-hash-object (after)
      
      ie we have a nice 24% size reduction from this trivial cleanup.
      
      It's not just that one file either. I get:
      
      	[torvalds@nehalem git]$ du -s /home/torvalds/libexec/git-core
      	45640	/home/torvalds/libexec/git-core (before)
      	33508	/home/torvalds/libexec/git-core (after)
      
      so we're talking 12MB of diskspace here.
      
      (Of course, stripping all the binaries brings the 33MB down to 9MB, so the
      whole debug information thing is still the bulk of it all, but that's a
      separate issue entirely)
      
      Now, I'm sure there are other things we should do, and changing our
      compiler flags from -O2 to -Os would bring the text size down by an
      additional almost 20%, but this thing Exal pointed out seems to be some
      good low-hanging fruit.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fb7d3f32
  23. 13 9月, 2009 1 次提交
  24. 22 8月, 2009 2 次提交
  25. 15 8月, 2009 1 次提交
  26. 09 7月, 2009 1 次提交
    • L
      Add 'fill_directory()' helper function for directory traversal · 1d8842d9
      Linus Torvalds 提交于
      Most of the users of "read_directory()" actually want a much simpler
      interface than the whole complex (but rather powerful) one.
      
      In fact 'git add' had already largely abstracted out the core interface
      issues into a private "fill_directory()" function that was largely
      applicable almost as-is to a number of callers.  Yes, 'git add' wants to
      do some extra work of its own, specific to the add semantics, but we can
      easily split that out, and use the core as a generic function.
      
      This function does exactly that, and now that much simplified
      'fill_directory()' function can be shared with a number of callers,
      while also ensuring that the rather more complex calling conventions of
      read_directory() are used by fewer call-sites.
      
      This also makes the 'common_prefix()' helper function private to dir.c,
      since all callers are now in that file.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1d8842d9
  27. 28 6月, 2009 1 次提交
    • T
      Use die_errno() instead of die() when checking syscalls · 0721c314
      Thomas Rast 提交于
      Lots of die() calls did not actually report the kind of error, which
      can leave the user confused as to the real problem.  Use die_errno()
      where we check a system/library call that sets errno on failure, or
      one of the following that wrap such calls:
      
        Function              Passes on error from
        --------              --------------------
        odb_pack_keep         open
        read_ancestry         fopen
        read_in_full          xread
        strbuf_read           xread
        strbuf_read_file      open or strbuf_read_file
        strbuf_readlink       readlink
        write_in_full         xwrite
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0721c314
  28. 21 6月, 2009 1 次提交
    • L
      Fix various sparse warnings in the git source code · 2af202be
      Linus Torvalds 提交于
      There are a few remaining ones, but this fixes the trivial ones. It boils
      down to two main issues that sparse complains about:
      
       - warning: Using plain integer as NULL pointer
      
         Sparse doesn't like you using '0' instead of 'NULL'. For various good
         reasons, not the least of which is just the visual confusion. A NULL
         pointer is not an integer, and that whole "0 works as NULL" is a
         historical accident and not very pretty.
      
         A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
         I didn't touch those.
      
       - warning: symbol 'xyz' was not declared. Should it be static?
      
         Sparse wants to see declarations for any functions you export. A lack
         of a declaration tends to mean that you should either add one, or you
         should mark the function 'static' to show that it's in file scope.
      
         A few of these remain: I only did the ones that should obviously just
         be made static.
      
      That 'wt_status_submodule_summary' one is debatable. It has a few related
      flags (like 'wt_status_use_color') which _are_ declared, and are used by
      builtin-commit.c. So maybe we'd like to export it at some point, but it's
      not declared now, and not used outside of that file, so 'static' it is in
      this patch.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2af202be
  29. 19 6月, 2009 1 次提交
  30. 25 5月, 2009 1 次提交
  31. 09 5月, 2009 1 次提交
    • J
      add: don't complain when adding empty project root · 07d7bedd
      Jeff King 提交于
      We try to warn the user if one of their pathspecs caused no
      matches, as it may have been a typo. However, we disable the
      warning if the pathspec points to an existing file, since
      that means it is not a typo but simply an empty directory.
      
      Unfortunately, the file_exists() test was broken for one
      special case: the pathspec of the project root is just "".
      This patch detects this special case and acts as if the file
      exists (which it must, since it is the project root).
      
      The user-visible effect is that this:
      
        $ mkdir repo && cd repo && git init && git add .
      
      used to complain like:
      
        fatal: pathspec '' did not match any files
      
      but now is a silent no-op.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      07d7bedd
  32. 13 4月, 2009 1 次提交
    • J
      git-add: introduce --edit (to edit the diff vs. the index) · c59cb03a
      Johannes Schindelin 提交于
      With "git add -e [<files>]", Git will fire up an editor with the current
      diff relative to the index (i.e. what you would get with "git diff
      [<files>]").
      
      Now you can edit the patch as much as you like, including adding/removing
      lines, editing the text, whatever.  Make sure, though, that the first
      character of the hunk lines is still a space, a plus or a minus.
      
      After you closed the editor, Git will adjust the line counts of the hunks
      if necessary, thanks to the --recount option of apply, and commit the
      patch.  Except if you deleted everything, in which case nothing happens
      (for obvious reasons).
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c59cb03a
  33. 25 2月, 2009 1 次提交