git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] Remove tab character from conflicted files list part of the merge message
Date: Tue, 13 Mar 2007 13:09:43 +0000	[thread overview]
Message-ID: <200703131309.43767.andyparkins@gmail.com> (raw)

Merge can generate sections like this:
 Conflicts:
   file1
   file2
   file3
The filenames were moved forward by embedding a tab.  Tabs are variable
width, so there is no guarantee that the appearance would be the same on
different systems.  In this case the tabs are being used for formatting,
for formatting, spaces are better.

This patch simply swaps the tab for four spaces in the "Conflicts:"
section.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
The reason this makes a difference (to me), is that I often edit the
conflict section to say what the resolution of the conflict was,  I
happen to have expandtabs set for git log messages (to guarantee they
look the same regardless of the viewer's settings), and hadn't noticed
that git was putting tabs into the log message for me.

So what I thought I was formatting as (for example)

Conflicts:
    file.c
     * Chose upstream version over mine, but integrated my small typo fix.

Was appearing in the log display as

Conflicts:
        file.c
     * Chose upstream version over mine, but integrated my small typo fix.

Which isn't how I'd intended at all.

The fix is of course - no tabs.  Tabs for formatting is always going to cause
trouble, so this patch swaps the tab for spaces.

I don't think the actual number of spaces is important (I chose 4), as long
as there are no tab-surprises in the log message (unless the user put them
there themselves of course - but that's their own fault).


 git-merge.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-merge.sh b/git-merge.sh
index 6ce62c8..a03d22b 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -482,7 +482,7 @@ else
 Conflicts:
 '
 		git ls-files --unmerged |
-		sed -e 's/^[^	]*	/	/' |
+		sed -e 's/^[^	]*	/    /' |
 		uniq
 	} >>"$GIT_DIR/MERGE_MSG"
 	if test -d "$GIT_DIR/rr-cache"
-- 
1.5.0.2.205.g74e20

             reply	other threads:[~2007-03-13 13:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13 13:09 Andy Parkins [this message]
2007-03-13 14:42 ` [PATCH] Remove tab character from conflicted files list part of the merge message Johannes Schindelin
2007-03-13 15:18   ` Andy Parkins
2007-03-13 15:44     ` Johannes Schindelin
2007-03-13 16:22       ` Andy Parkins
2007-03-14  9:26   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703131309.43767.andyparkins@gmail.com \
    --to=andyparkins@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).