From: Junio C Hamano <gitster@pobox.com>
To: David Greene <greened@obbligato.org>
Cc: git@vger.kernel.org, techlivezheng@gmail.com,
alex.crezoff@gmail.com, davvid@gmail.com,
cbailey32@bloomberg.net, danny0838@gmail.com, prohaska@zib.de,
th.acker@arcor.de, sschuberth@gmail.com, peff@peff.net,
gitter.spiros@gmail.com, nod.helm@gmail.com
Subject: Re: [PATCH] contrib/subtree: Remove --annotate
Date: Tue, 05 Jan 2016 09:33:33 -0800 [thread overview]
Message-ID: <xmqqsi2cj5hu.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1451963101-4901-2-git-send-email-greened@obbligato.org> (David Greene's message of "Mon, 4 Jan 2016 21:05:01 -0600")
David Greene <greened@obbligato.org> writes:
> From: "David A. Greene" <greened@obbligato.org>
>
> Remove --annotate. This obviates the need for an --unannotate
> command, which is both an obvious addition and difficult to define
> due to the numerous ways one might want to specify how to edit
> commit messages. git has other tools more suited to rewriting
> commit messages and it's easy enough to use them after a subtree
> split. Such tools include filter-branch, rebase -i and
> commit --amend.
I do not think that "there are other ways to do this" is a good
justification for removing a feature, unless it can be shown that
nobody is using it, of course.
> @@ -319,7 +315,7 @@ copy_commit()
> GIT_COMMITTER_NAME \
> GIT_COMMITTER_EMAIL \
> GIT_COMMITTER_DATE
> - (printf "%s" "$annotate"; cat ) |
> + (echo -n ""; cat ) |
I can see that by changing "printf something" with 'echo -n ""', you
are making it clear that we are stopping to add that something to
the pipeline, but (1) I think the intended effect of running 'echo
-n' on an empty string is to do nothing, and (2) 'echo -n' is not
portable [*1*], so this leaves a puzzling code that makes future
readers scratch their heads.
I wonder why this cannot be simply the removal of the entire line,
making the resulting implementation more like this:
git log -1 --pretty=format:... "$1" |
(
read ... various variables ...
export ... various variables ...
- (printf "%s" "$annotate"; cat ) |
git commit-tree "$2" $3 # reads the rest of stdin
) || die "cannot copy"
That is, just feed the remainder of what is coming directly to the
command?
[Footnote]
*1* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
says """Implementations shall not support any options."""; '-n'
comes from BSD and SysV way of supressing the final newline is to
end the string with "\c".
next prev parent reply other threads:[~2016-01-05 17:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-05 3:05 [PATCH v2] Remote subtree split --annotate David Greene
2016-01-05 3:05 ` [PATCH] contrib/subtree: Remove --annotate David Greene
2016-01-05 17:33 ` Junio C Hamano [this message]
2016-01-05 21:35 ` David A. Greene
2016-01-15 18:54 ` Junio C Hamano
2016-01-17 23:30 ` David A. Greene
2016-01-18 1:29 ` Junio C Hamano
2016-06-28 11:10 ` David A. Greene
-- strict thread matches above, loose matches on Subject: below --
2016-01-02 20:36 Remote subtree split --annotate David Greene
2016-01-02 20:36 ` [PATCH] contrib/subtree: Remove --annotate David Greene
2016-01-03 9:06 ` Sebastian Schuberth
2016-01-04 15:53 ` greened
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqsi2cj5hu.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=alex.crezoff@gmail.com \
--cc=cbailey32@bloomberg.net \
--cc=danny0838@gmail.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitter.spiros@gmail.com \
--cc=greened@obbligato.org \
--cc=nod.helm@gmail.com \
--cc=peff@peff.net \
--cc=prohaska@zib.de \
--cc=sschuberth@gmail.com \
--cc=techlivezheng@gmail.com \
--cc=th.acker@arcor.de \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).