1. 01 2月, 2006 3 次提交
  2. 31 1月, 2006 5 次提交
  3. 30 1月, 2006 9 次提交
  4. 28 1月, 2006 23 次提交
    • J
      Documentation: diff -c/--cc · 34801cab
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      34801cab
    • J
      diff-files -c/--cc: combine only when both ours and theirs exist. · 939aabbf
      Junio C Hamano 提交于
      The previous round forgot to make sure there actually are two
      versions to compare against the working tree version.  Otherwise
      using -c/--cc would not make much sense.
      
      Also plug a small memory leak.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      939aabbf
    • J
      Merge lt/revlist,jc/diff,jc/revparse,jc/abbrev · addafaf9
      Junio C Hamano 提交于
      addafaf9
    • J
      rev-parse: make "whatchanged -- git-fetch-script" work again. · b33aba51
      Junio C Hamano 提交于
      The latest update to avoid misspelled revs interfered when we
      were not interested in parsing non flags or arguments not meant
      for rev-list.  This makes these two forms work again:
      
      	git whatchanged -- git-fetch-script
      
      We could enable "!def" in the part this change touches to make
      the above work without '--', but then it would cause misspelled
      v2.6.14..v2.6.16 to be given to diff-tree and defeats the whole
      point of the previous fix.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b33aba51
    • J
      diff --abbrev=<n> option fix. · 6b1ddbdd
      Junio C Hamano 提交于
      Earier specifying an abbreviation shorter than minimum fell back
      to full 40 letters, which was nonsense.  Make it to fall back to
      the minimum number (currently 4).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6b1ddbdd
    • J
      pretty_print_commit: honor grafts. · f2d42275
      Junio C Hamano 提交于
      When displaying Merge: lines, we used to take the real commit
      parents from the commit objects.  Use the parsed parents from
      the commit object instead, so that we honor fake parent
      information from info/grafts.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f2d42275
    • J
    • J
      Rename rev-parse --abbrev to --short. · 62a604ba
      Junio C Hamano 提交于
      The usage of rev-parse to serve as a flag/option parser
      for git-whatchanged and other commands have serious limitation
      that the flags cannot be something that is supported by
      rev-parse itself, and it cannot worked around easily.  Since
      this is rarely used "poor-man's describe", rename the option for
      now as an easier workaround.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      62a604ba
    • J
      rev-parse --abbrev: do not try abbrev shorter than minimum. · 1dc4fb84
      Junio C Hamano 提交于
      We do not allow abbreviation shorter than 4 letters in other
      parts of the system so do not attempt to generate such.
      
      Noticed by Uwe Zeisberger.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1dc4fb84
    • J
      diff-tree: abbreviate merge parent object names with --abbrev --pretty. · b2d4c56f
      Junio C Hamano 提交于
      When --abbrev is in effect, abbreviate the merge parent names
      in prettyprinted output.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b2d4c56f
    • J
      rev-parse: --abbrev option. · d5012508
      Junio C Hamano 提交于
      The new option behaves just like --verify, but outputs an
      abbreviated object name that is unique within the repository.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d5012508
    • J
      abbrev cleanup: use symbolic constants · 46a6c262
      Junio C Hamano 提交于
      The minimum length of abbreviated object name was hardcoded in
      different places to be 4, risking inconsistencies in the future.
      Also there were three different "default abbreviation
      precision".  Use two C preprocessor symbols to clean up this
      mess.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      46a6c262
    • J
      93b74bca
    • L
      rev-list: stop when the file disappears · 461cf59f
      Linus Torvalds 提交于
      The one thing I've considered doing (I really should) is to add a "stop
      when you don't find the file" option to "git-rev-list". This patch does
      some of the work towards that: it removes the "parent" thing when the
      file disappears, so a "git annotate" could do do something like
      
      	git-rev-list --remove-empty --parents HEAD -- "$filename"
      
      and it would get a good graph that stops when the filename disappears
      (it's not perfect though: it won't remove all the unintersting commits).
      
      It also simplifies the logic of finding tree differences a bit, at the
      cost of making it a tad less efficient.
      
      The old logic was two-phase: it would first simplify _only_ merges tree as
      it traversed the tree, and then simplify the linear parts of the remainder
      independently. That was pretty optimal from an efficiency standpoint
      because it avoids doing any comparisons that we can see are unnecessary,
      but it made it much harder to understand than it really needed to be.
      
      The new logic is a lot more straightforward, and compares the trees as it
      traverses the graph (ie everything is a single phase). That makes it much
      easier to stop graph traversal at any point where a file disappears.
      
      As an example, let's say that you have a git repository that has had a
      file called "A" some time in the past. That file gets renamed to B, and
      then gets renamed back again to A. The old "git-rev-list" would show two
      commits: the commit that renames B to A (because it changes A) _and_ as
      its parent the commit that renames A to B (because it changes A).
      
      With the new --remove-empty flag, git-rev-list will show just the commit
      that renames B to A as the "root" commit, and stop traversal there
      (because that's what you want for "annotate" - you want to stop there, and
      for every "root" commit you then separately see if it really is a new
      file, or if the paths history disappeared because it was renamed from some
      other file).
      
      With this patch, you should be able to basically do a "poor mans 'git
      annotate'" with a fairly simple loop:
      
      	push("HEAD", "$filename")
      	while (revision,filename = pop()) {
      		for each i in $(git-rev-list --parents --remove-empty $revision -- "$filename")
      
      		pseudo-parents($i) = git-rev-list parents for that line
      
      		if (pseudo-parents($i) is non-empty) {
      			show diff of $i against pseudo-parents
      			continue
      		}
      
      		/* See if the _real_ parents of $i had a rename */
      		parent($i) = real-parent($i)
      		if (find-rename in $parent($i)->$i)
      			push $parent($i), "old-name"
      	}
      
      which should be doable in perl or something (doing stacks in shell is just
      too painful to be worth it, so I'm not going to do this).
      
      Anybody want to try?
      
      		Linus
      461cf59f
    • J
      diff-files: -c and --cc options. · ea726d02
      Junio C Hamano 提交于
      This ports the "combined diff" to diff-files so that differences
      to the working tree files since stage 2 and stage 3 are shown
      the same way as combined diff output from diff-tree for the
      merge commit would be shown if the current working tree files
      are committed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ea726d02
    • J
      combine-diff: better hunk splitting. · 3ec1909f
      Junio C Hamano 提交于
      It considered an otherwise unchanged line that had line removals
      in front of it an interesting line, which caused hunks to have
      one extra the trailing context line.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      3ec1909f
    • J
      diff-tree --cc: squelch header generation on empty patch. · 8828cdcb
      Junio C Hamano 提交于
      Earlier round showed the commit log header and "diff --combined"
      header even for paths that had no interesting hunk under --cc
      flag.  Move the header display logic around to squelch them.
      With this, a merge that does not have any interesting merges
      will not be shown with --cc option, unless -m is used at the
      same time.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      8828cdcb
    • J
      combine-diff: extend --cc logic to Octopus. · 263eee29
      Junio C Hamano 提交于
      Santi Bejar points out that a hunk that changes from all the
      same common parents except one is uninteresting.  The earlier
      round marked changes from only one parent uninteresting, but
      this also marks hunks that have the same change from all but one
      parent uninteresting, which is a natural extension of the
      original idea to Octopus merges.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      263eee29
    • J
      combine-diff: minor output changes. · e2283409
      Junio C Hamano 提交于
      Remove extra whitespace between the change indicators and the
      body text.  That is more in line with the uncombined unified
      diff output (pointed out by Santi Bejar).
      
      When showing --cc, say so instead of saying just --combined.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e2283409
    • J
      combine-diff: fix appending at the tail of a list. · 5290a0f8
      Junio C Hamano 提交于
      ... and use the established pattern of tail initialized to point
      at the head pointer for an empty list, and updated to point at
      the next pointer field of the item at the tail when appending.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5290a0f8
    • J
      diff-tree --cc: denser combined diff output for a merge commit. · d8f4790e
      Junio C Hamano 提交于
      Building on the previous '-c' (combined) option, '--cc' option
      squelches the output further by omitting hunks that consist of
      difference with solely one parent.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d8f4790e
    • J
      diff-tree -c: show a merge commit a bit more sensibly. · af3feefa
      Junio C Hamano 提交于
      A new option '-c' to diff-tree changes the way a merge commit is
      displayed when generating a patch output.  It shows a "combined
      diff" (hence the option letter 'c'), which looks like this:
      
          $ git-diff-tree --pretty -c -p fec9ebf1 | head -n 18
          diff-tree fec9ebf1... (from parents)
          Merge: 0620db36... 8a263aeb...
          Author: Junio C Hamano <junkio@cox.net>
          Date:   Sun Jan 15 22:25:35 2006 -0800
      
      	Merge fixes up to GIT 1.1.3
      
          diff --combined describe.c
          @@@ +98,7 @@@
      	    return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
             }
      
          -  static void describe(char *arg)
           - static void describe(struct commit *cmit, int last_one)
          ++ static void describe(char *arg, int last_one)
             {
           +      unsigned char sha1[20];
           +      struct commit *cmit;
      
      There are a few things to note about this feature:
      
       - The '-c' option implies '-p'.  It also implies '-m' halfway
         in the sense that "interesting" merges are shown, but not all
         merges.
      
       - When a blob matches one of the parents, we do not show a diff
         for that path at all.  For a merge commit, this option shows
         paths with real file-level merge (aka "interesting things").
      
       - As a concequence of the above, an "uninteresting" merge is
         not shown at all.  You can use '-m' in addition to '-c' to
         show the commit log for such a merge, but there will be no
         combined diff output.
      
       - Unlike "gitk", the output is monochrome.
      
      A '-' character in the nth column means the line is from the nth
      parent and does not appear in the merge result (i.e. removed
      from that parent's version).
      
      A '+' character in the nth column means the line appears in the
      merge result, and the nth parent does not have that line
      (i.e. added by the merge itself or inherited from another
      parent).
      
      The above example output shows that the function signature was
      changed from either parents (hence two "-" lines and a "++"
      line), and "unsigned char sha1[20]", prefixed by a " +", was
      inherited from the first parent.
      
      The code as sent to the list was buggy in few corner cases,
      which I have fixed since then.
      
      It does not bother to keep track of and show the line numbers
      from parent commits, which it probably should.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      af3feefa
    • J
      merge: seed the commit message with list of conflicted files. · 6b94f1e4
      Junio C Hamano 提交于
      The files with conflicts need to be hand resolved, and it is a
      good discipline for the committer to explain which branch was
      taken and why.  Pre-fill the merge message template with the
      list of conflicted paths to encourage it.
      
      This is from Linus.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6b94f1e4