From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Simpkins Subject: [PATCH] Add new git-graph command Date: Sun, 30 Mar 2008 12:58:41 -0700 Message-ID: <20080330195840.GA8695@adamsimpkins.net> Reply-To: Adam Simpkins Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Mar 30 22:26:03 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jg46G-0002Ma-MG for gcvg-git-2@gmane.org; Sun, 30 Mar 2008 22:25:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbYC3UZN (ORCPT ); Sun, 30 Mar 2008 16:25:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753355AbYC3UZN (ORCPT ); Sun, 30 Mar 2008 16:25:13 -0400 Received: from smtp112.iad.emailsrvr.com ([207.97.245.112]:47713 "EHLO smtp112.iad.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753396AbYC3UZK (ORCPT ); Sun, 30 Mar 2008 16:25:10 -0400 X-Greylist: delayed 1583 seconds by postgrey-1.27 at vger.kernel.org; Sun, 30 Mar 2008 16:25:10 EDT Received: from relay1.r1.iad.emailsrvr.com (localhost [127.0.0.1]) by relay1.r1.iad.emailsrvr.com (SMTP Server) with ESMTP id F245A44C016 for ; Sun, 30 Mar 2008 15:58:44 -0400 (EDT) Received: by relay1.r1.iad.emailsrvr.com (Authenticated sender: simpkins-AT-adamsimpkins.net) with ESMTP id 45E5644C002 for ; Sun, 30 Mar 2008 15:58:44 -0400 (EDT) Received: by sleipnir.adamsimpkins.net (Postfix, from userid 1000) id E2A0E14100B8; Sun, 30 Mar 2008 12:58:41 -0700 (PDT) Content-Disposition: inline User-Agent: Mutt/1.5.13 (2006-08-11) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: This is a first pass at a command to print a text-based graph of the commit history. It is similar to the history graph shown by gitk, but doesn't require a windowing system. Signed-off-by: Adam Simpkins --- I added this since I really like gitk, but don't always have easy access to an X display on some of the systems I use. I tried using tig, but I found its graph output very hard to read. The graph produced by git-graph is less compact, but much more readable. Ultimately, it would probably be better to integrate this functionality into git-log, instead of having it as a standalone command. For example, a new --graph option could be added to cause the graph to be displayed alongside the existing git log output. However, this would require tighter integration between the graphing code and the log_tree.c and pretty.c code, which I'm not all that familiar with. .gitignore | 1 + Documentation/git-graph.txt | 56 ++++ Documentation/pretty-formats.txt | 4 + Documentation/rev-list-options.txt | 15 + Makefile | 1 + builtin-graph.c | 553 ++++++++++++++++++++++++++++++++++++ builtin.h | 1 + git.c | 1 + 8 files changed, 632 insertions(+), 0 deletions(-) create mode 100644 Documentation/git-graph.txt create mode 100644 builtin-graph.c diff --git a/.gitignore b/.gitignore index 4ff2fec..b9b4c76 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ git-fsck git-fsck-objects git-gc git-get-tar-commit-id +git-graph git-grep git-hash-object git-http-fetch diff --git a/Documentation/git-graph.txt b/Documentation/git-graph.txt new file mode 100644 index 0000000..022cb09 --- /dev/null +++ b/Documentation/git-graph.txt @@ -0,0 +1,56 @@ +git-graph(1) +============ + +NAME +---- +git-graph - Show a graph of commit history + + +SYNOPSIS +-------- +'git-graph'