Re: [PATCH] Builtin-commit: show on which branch a commit was added

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Sep 06, 2008 at 10:27:44PM -0700, Junio C Hamano wrote:

> Given the recent "reminder" discussion, I suspect people without $PS1 set
> to show the current branch would like this, majority of others would be
> neutral, while some may actively hate it for cluttering the output even
> more.  But I also suspect the initial annoyance the third camp may feel
> will pass rather quickly after they get used to seeing these.

OK, I have lived with it for a little while, and I am still annoyed. ;)

My complaints are:

  1. It wastes more horizontal screen real estate, making it more likely
     that the line will wrap.

  2. In almost all of my projects (including git), I use the subject
     line convention of "subsystem: one line summary". So you end up
     with the visually confusing:

       Created commit abcd1234 on master: subsystem: one line summary

     which is even worse on a topic branch which is meaningful to the
     project:

       Created commit abcd1234 on widget: subwidget: one line summary

     which has literally left me scratching my head wondering why I put
     "widget" into the commit message.

Maybe it is better to simply break the line, which solves both problems.
Something like:

  Created commit abcd1234 on master:
   subsystem: do some stuff
   1 files changes, 1 insertions(+), 0 deletions(-)

Trivial patch is below.

---
diff --git a/builtin-commit.c b/builtin-commit.c
index 917f638..53dcde6 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -899,7 +899,7 @@ static char *get_commit_format_string(void)
 				strbuf_addch(&buf, *cp);
 		}
 	}
-	strbuf_addstr(&buf, ": %s");
+	strbuf_addstr(&buf, ":%n %s");
 
 	return strbuf_detach(&buf, NULL);
 }


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux