All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: John Keeping <john@keeping.me.uk>
Cc: git@vger.kernel.org, Ralf Thielow <ralf.thielow@gmail.com>
Subject: Re: [PATCH v2] rebase -i: respect core.commentchar
Date: Mon, 11 Feb 2013 16:13:31 -0800	[thread overview]
Message-ID: <7vehgmjsno.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20130211230804.GF2270@serenity.lan

John Keeping <john@keeping.me.uk> writes:

> @@ -179,7 +182,9 @@ die_abort () {
>  }
>  
>  has_action () {
> -	sane_grep '^[^#]' "$1" >/dev/null
> +	echo "space stripped actions:" >&2
> +	git stripspace --strip-comments <"$1" >&2
> +	test -n "$(git stripspace --strip-comments <"$1")"
>  }

I'll remove the debugging remnants while queuing.

>  	fixup)
>  		echo
> -		echo "# The $(nth_string $count) commit message will be skipped:"
> +		printf '%s\n' "$comment_char The $(nth_string $count) commit message will be skipped:"
>  		echo
> -		commit_message $2 | sed -e 's/^/#	/'
> +		# Change the space after the comment character to TAB:
> +		commit_message $2 | git stripspace --comment-lines | sed -e 's/ /	/'

I think this changes the behaviour but in a good way.  It used to
show an empty line in the incoming commit message to a hash followed
by a trailing HT before the end of line, but now it only emits the
comment char immediately followed by the end of line.

> @@ -942,20 +948,18 @@ test -s "$todo" || echo noop >> "$todo"
>  test -n "$autosquash" && rearrange_squash "$todo"
>  test -n "$cmd" && add_exec_commands "$todo"
>  
> -cat >> "$todo" << EOF
> -
> -# Rebase $shortrevisions onto $shortonto
> -EOF
> +echo >>"$todo"
> +printf '%s\n' "$comment_char Rebase $shortrevisions onto $shortonto" >>"$todo"

I think you can still do

	cat >>"$todo" <<EOF

	$comment_char Rebase $shortrevisions onto...
	EOF

here with any funny comment character.  Doing this with two separate
I/O does not hurt very much, but the resulting code may be easier to
scan if left as here-text with a single cat.

Please eyeball what is in 'pu' (I have a separate squashable fixup
on top of your patch) and let me know if I made mistakes.

Thanks for working on this.

  reply	other threads:[~2013-02-12  0:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-11 19:21 [PATCH] rebase -i: respect core.commentchar John Keeping
2013-02-11 20:17 ` Junio C Hamano
2013-02-11 21:39   ` John Keeping
2013-02-11 21:49     ` Junio C Hamano
2013-02-11 23:08       ` [PATCH v2] " John Keeping
2013-02-12  0:13         ` Junio C Hamano [this message]
2013-02-12  9:53           ` John Keeping
2013-02-12 17:29             ` Junio C Hamano
2013-02-12 17:53               ` John Keeping
2013-02-12 18:21                 ` Junio C Hamano
2013-02-12 18:00               ` Junio C Hamano
2013-02-12 18:09                 ` John Keeping
2013-02-12 18:23                   ` 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=7vehgmjsno.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=john@keeping.me.uk \
    --cc=ralf.thielow@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.