git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitweb using "--cc"?

From
Junio C Hamano <junkio@cox.net>
Date
Feb 11, 2006, 20:59 UTC
Message-ID
<7vslqplih3.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<e5bfff550602110117i7b742351m14e908de10aac12c@mail.gmail.com>
Marco Costalba <mcostalba@gmail.com> writes:
Show 7 quoted lines
> Please _do not_ change this behaviour to make -m a no-op as stated in
> "diff-tree -c raw output" patch message
> (ee63802422af14e43eccce3c6dc4150a27ceb1a3).
>
> qgit has the possibility to switch from "see all merge files"
> to "see interesting only", so we really need that difference
> between 'git-diff-tree -r' and 'git-diff-tree -r -m'

Let me make sure I am not misreading you. You are proposing to revert making -m a no-op. So '-r' and '-r -m' would do different things, like illustrated in the log message below.

All of the above combinations of flags produces the same result for non-merge commit, by the way.

Ack, or did I grossly misunderstand what you wanted?

-- >8 -- [PATCH] diff-tree: do not default to -c

Marco says it breaks qgit. This makes the flags a bit more orthogonal.

  $ git-diff-tree -r --abbrev ca18
    No output from this command because you asked to skip merge by
    not having -m there.
  $ git-diff-tree -r -m --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  :100644 100644 538d21d... 59042d1... M	Makefile
  :100644 100644 410b758... 6c47c3a... M	entry.c
  ca182053c7710a286d72102f4576cf32e0dafcfb
  :100644 100644 30479b4... 59042d1... M	Makefile
    The same "independent sets of diff" as before without -c.
  $ git-diff-tree -r -m -c --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  ::100644 100644 100644 538d21d... 30479b4... 59042d1... MM	Makefile
    Combined.
  $ git-diff-tree -r -c --abbrev ca18
  ca182053c7710a286d72102f4576cf32e0dafcfb
  ::100644 100644 100644 538d21d... 30479b4... 59042d1... MM	Makefile
    Asking for combined without -m does not make sense, so -c
    implies -m.

We need to supply -c as default to whatchanged, which is a one-liner.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/diff-tree.c b/diff-tree.c
index b170b03..f55a35a 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -6,7 +6,7 @@ static int show_root_diff = 0;
 static int no_commit_id = 0;
 static int verbose_header = 0;
 static int ignore_merges = 1;
-static int combine_merges = 1;
+static int combine_merges = 0;
 static int dense_combined_merges = 0;
 static int read_stdin = 0;
 static int always_show_header = 0;
@@ -248,7 +248,7 @@ int main(int argc, const char **argv)
 			continue;
 		}
 		if (!strcmp(arg, "-m")) {
-			combine_merges = ignore_merges = 0;
+			ignore_merges = 0;
 			continue;
 		}
 		if (!strcmp(arg, "-c")) {
diff --git a/git-whatchanged.sh b/git-whatchanged.sh
index 574fc35..1fb9feb 100755
--- a/git-whatchanged.sh
+++ b/git-whatchanged.sh
@@ -10,7 +10,7 @@ case "$0" in
 	count=
 	test -z "$diff_tree_flags" &&
 		diff_tree_flags=$(git-repo-config --get whatchanged.difftree)
-	diff_tree_default_flags='-M --abbrev' ;;
+	diff_tree_default_flags='-c -M --abbrev' ;;
 *show)
 	count=-n1
 	test -z "$diff_tree_flags" &&
Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 27 in “gitweb using "--cc"?”
  1. Linus TorvaldsFeb 8, 2006
  2. Junio C HamanoFeb 8, 2006
  3. Use describe to come up with the closest tag.Junio C Hamano, Feb 9, 2006
  4. Allow using --cc when showing a merge.Junio C Hamano, Feb 9, 2006
  5. Brian GerstFeb 9, 2006
  6. Linus TorvaldsFeb 9, 2006
  7. Junio C HamanoFeb 9, 2006
  8. Linus TorvaldsFeb 9, 2006
  9. Linus TorvaldsFeb 9, 2006
  10. Linus TorvaldsFeb 9, 2006
  11. Junio C HamanoFeb 9, 2006
  12. Linus TorvaldsFeb 9, 2006
  13. Linus TorvaldsFeb 9, 2006
  14. Junio C HamanoFeb 9, 2006
  15. Junio C HamanoFeb 9, 2006
  16. Junio C HamanoFeb 9, 2006
  17. Junio C HamanoFeb 9, 2006
  18. Junio C HamanoFeb 9, 2006
  19. Marco CostalbaFeb 11, 2006
  20. Junio C HamanoFeb 11, 2006
  21. Junio C HamanoFeb 11, 2006
  22. Junio C HamanoFeb 9, 2006
  23. Linus TorvaldsFeb 9, 2006
  24. Junio C HamanoFeb 9, 2006
  25. combine-diff: Record diff status a bit more faithfullyJunio C Hamano, Feb 10, 2006
  26. combine-diff: move formatting logic to show_combined_diff()Junio C Hamano, Feb 9, 2006
  27. Kay SieversFeb 9, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.