Thanks, Thomas!

FWIW, to set up what I'm seeing, in any branch you can add one of these
commits:

    $ git merge `echo -n "No trailing newline" | git commit-tree
HEAD^{tree} -p HEAD`
    $ git log -n 1 --format=:%H:%B:
    : 4a11052c110c3daea46c89ae1118b1a2c59cc01b:No trailing newline:

I would expect that neither of these commands modifies any commits:
    git filter-branch --commit-filter 'git commit-tree $@'
    git filter-branch --commit-filter 'git commit-tree -F - $@'

On git 1.8.4 on Ubuntu 12.04 (build from
https://launchpad.net/~git-core/+archive/ppa), using "-F -" seems to add a
linefeed to the body:

    $ git filter-branch --commit-filter 'git commit-tree $@'
    Rewrite 4a11052c110c3daea46c89ae1118b1a2c59cc01b (2/2)
    WARNING: Ref 'refs/heads/master' is unchanged
    $ git filter-branch --commit-filter 'git commit-tree -F - $@'
    Rewrite 4a11052c110c3daea46c89ae1118b1a2c59cc01b (2/2)
    Ref 'refs/heads/master' was rewritten
    $ git log -n 1 --format=:%H:%B:
    :5ecba0ff0ca1290f2a5e3a599622e2a59e311f67:No trailing newline
    :

Using git version 1.7.12.4 (Apple Git-37) on Mac OS X, *both* uses of
commit-tree (with and without the "-F -") modify the commit and add a
newline.

I'll report it to the Git devs.



On Thu, Oct 24, 2013 at 12:39 AM, Thomas Ferris Nicolaisen <tfn...@gmail.com
> wrote:

> On Wednesday, October 23, 2013 7:34:02 PM UTC+2, Mickey Killianey wrote:
>
>> I expected that these two would be equivalent, and that neither would end
>> up modifying any commits:
>>
>>    git filter-branch --commit-filter '*git commit-tree $@*'
>>    git filter-branch --commit-filter '*git commit-tree -F - $@*'
>>
>> However, I have discovered that the latter *does* modify some commits.
>>  Using "-F -" appears to add a terminating newline at the end of any
>> message body that doesn't already end in a newline.
>>
>> (FWIW, these commits without newlines at the end of the message appear to
>> have been introduced by merging pull-requests using the github GUI.)
>>
>> Three questions:
>> Is this a bug or a feature?
>> If this is a bug, where should I report it?
>> If this is a feature, are there any other differences I should expect
>> between these two forms of git commit-tree?
>>
>
> I don't know whether this is a bug, but if you want to get in touch with
> the Git devs, here's how to find them:
> https://gist.github.com/tfnico/4441562
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Git for human beings" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/git-users/RLXmzeUM3wY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to