On Aug 7, 2013, at 11:31, John Keeping wrote:
On Wed, Aug 07, 2013 at 11:01:57AM -0700, Kyle J. McKay wrote:
On Aug 7, 2013, at 09:00, Ramkumar Ramachandra wrote:

This is the difference between whatchanged and log:

diff --git a/whatchanged b/log
index fa1b223..004d9aa 100644
--- a/tmp/whatchanged
+++ b/tmp/log
@@ -1,4 +1,4 @@
-int cmd_whatchanged(int argc, const char **argv, const char *prefix)
+int cmd_log(int argc, const char **argv, const char *prefix)
      struct rev_info rev;
      struct setup_revision_opt opt;
@@ -7,13 +7,10 @@ int cmd_whatchanged(int argc, const char **argv,
const char *prefix)
      git_config(git_log_config, NULL);

      init_revisions(&rev, prefix);
-       rev.diff = 1;
-       rev.simplify_history = 0;
+       rev.always_show_header = 1;
      memset(&opt, 0, sizeof(opt));
      opt.def = "HEAD";
      opt.revarg_opt = REVARG_COMMITTISH;
      cmd_log_init(argc, argv, prefix, &rev, &opt);
-       if (!rev.diffopt.output_format)
-               rev.diffopt.output_format = DIFF_FORMAT_RAW;
      return cmd_log_walk(&rev);

Should we remove it?

I use it all the time.  Is there some log option to get exactly the
same output? It doesn't appear that there is. The closest looks like
"log --name-status" but it omits the modes and hash values.

Is it not identical to "log --raw --no-merges"?

A quick test says "mostly", but whatchanged doesn't show empty commits
whereas log does seem to; e.g. in git.git:

   diff -u <(git whatchanged) <(git log --raw --no-merges)

That's probably close enough, but if that's all "whatchanged" does is basically be an alias for "log --raw --no-merges" that skips commits with no changes then the help for whatchanged ought to mention that.

I still think "git whatchanged" is a lot clearer than "git log --raw -- no-merges" though.
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to