You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2016/08/06 17:38:36 UTC

Git Commit log with wrong encoding

Hi,

I have accidently committed a change in Git with a log message which 
contains wrongly encoded characters...

What is the best to handle this?

git commit --amend ..

and

git push -f

?

Kind regards
Karl Heinz


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Fred Cooke <fr...@gmail.com>.
The solution is to not push directly, and to seek peer review even if
you're the king of the hill. Once pushed to a public upstream a commit
should pretty much never be touched.

What was the impact of the encoding being wrong? I haven't yet understood
the actual problem.

On Sun, Aug 7, 2016 at 6:38 AM, Michael Osipov <mi...@apache.org> wrote:

> Am 2016-08-06 um 20:35 schrieb Karl Heinz Marbaise:
>
>> On 8/6/16 8:29 PM, Michael Osipov wrote:
>>
>>> Am 2016-08-06 um 20:24 schrieb Karl Heinz Marbaise:
>>>
>>>> Hi Michael,
>>>>
>>>> On 8/6/16 8:20 PM, Michael Osipov wrote:
>>>>
>>>>> Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
>>>>>
>>>>>> Hi Michael,
>>>>>>
>>>>>> On 8/6/16 7:46 PM, Michael Osipov wrote:
>>>>>>
>>>>>>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> I have accidently committed a change in Git with a log message which
>>>>>>>> contains wrongly encoded characters...
>>>>>>>>
>>>>>>>> What is the best to handle this?
>>>>>>>>
>>>>>>>> git commit --amend ..
>>>>>>>>
>>>>>>>> and
>>>>>>>>
>>>>>>>> git push -f
>>>>>>>>
>>>>>>>
>>>>>>> The ASF server will probably block history rewrite.
>>>>>>>
>>>>>>>
>>>>>> It works...So I have fixed the wrong encoding log message..
>>>>>>
>>>>>
>>>>> You were lucky because no one pulled yet from and if someone did and
>>>>> pushed again, that would be a pain.
>>>>>
>>>> I know about the risks I took...;-(...
>>>>
>>>> But would be the "better" way to fix such issue ?  Do you know a better
>>>> one?
>>>>
>>>
>>> From the top of my head, I would create an empty commit with a fixed
>>> message refencing the SHA1 which was fixed.
>>>
>>
>> But doesn't this kept the commit with the wrong encoded message or do i
>> misunderstand a thing ?
>>
>
> Correct but you don't rewrite history and don't mess up other people's
> cloned repo.
>
> See for details: http://stackoverflow.com/q/1491001/696632
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Git Commit log with wrong encoding

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-08-06 um 20:35 schrieb Karl Heinz Marbaise:
> On 8/6/16 8:29 PM, Michael Osipov wrote:
>> Am 2016-08-06 um 20:24 schrieb Karl Heinz Marbaise:
>>> Hi Michael,
>>>
>>> On 8/6/16 8:20 PM, Michael Osipov wrote:
>>>> Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
>>>>> Hi Michael,
>>>>>
>>>>> On 8/6/16 7:46 PM, Michael Osipov wrote:
>>>>>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have accidently committed a change in Git with a log message which
>>>>>>> contains wrongly encoded characters...
>>>>>>>
>>>>>>> What is the best to handle this?
>>>>>>>
>>>>>>> git commit --amend ..
>>>>>>>
>>>>>>> and
>>>>>>>
>>>>>>> git push -f
>>>>>>
>>>>>> The ASF server will probably block history rewrite.
>>>>>>
>>>>>
>>>>> It works...So I have fixed the wrong encoding log message..
>>>>
>>>> You were lucky because no one pulled yet from and if someone did and
>>>> pushed again, that would be a pain.
>>> I know about the risks I took...;-(...
>>>
>>> But would be the "better" way to fix such issue ?  Do you know a better
>>> one?
>>
>> From the top of my head, I would create an empty commit with a fixed
>> message refencing the SHA1 which was fixed.
>
> But doesn't this kept the commit with the wrong encoded message or do i
> misunderstand a thing ?

Correct but you don't rewrite history and don't mess up other people's 
cloned repo.

See for details: http://stackoverflow.com/q/1491001/696632


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
On 8/6/16 8:29 PM, Michael Osipov wrote:
> Am 2016-08-06 um 20:24 schrieb Karl Heinz Marbaise:
>> Hi Michael,
>>
>> On 8/6/16 8:20 PM, Michael Osipov wrote:
>>> Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
>>>> Hi Michael,
>>>>
>>>> On 8/6/16 7:46 PM, Michael Osipov wrote:
>>>>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>>>>> Hi,
>>>>>>
>>>>>> I have accidently committed a change in Git with a log message which
>>>>>> contains wrongly encoded characters...
>>>>>>
>>>>>> What is the best to handle this?
>>>>>>
>>>>>> git commit --amend ..
>>>>>>
>>>>>> and
>>>>>>
>>>>>> git push -f
>>>>>
>>>>> The ASF server will probably block history rewrite.
>>>>>
>>>>
>>>> It works...So I have fixed the wrong encoding log message..
>>>
>>> You were lucky because no one pulled yet from and if someone did and
>>> pushed again, that would be a pain.
>> I know about the risks I took...;-(...
>>
>> But would be the "better" way to fix such issue ?  Do you know a better
>> one?
>
> From the top of my head, I would create an empty commit with a fixed
> message refencing the SHA1 which was fixed.

But doesn't this kept the commit with the wrong encoded message or do i 
misunderstand a thing ?


Kind regards
Karl Heinz

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-08-06 um 20:24 schrieb Karl Heinz Marbaise:
> Hi Michael,
>
> On 8/6/16 8:20 PM, Michael Osipov wrote:
>> Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
>>> Hi Michael,
>>>
>>> On 8/6/16 7:46 PM, Michael Osipov wrote:
>>>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>>>> Hi,
>>>>>
>>>>> I have accidently committed a change in Git with a log message which
>>>>> contains wrongly encoded characters...
>>>>>
>>>>> What is the best to handle this?
>>>>>
>>>>> git commit --amend ..
>>>>>
>>>>> and
>>>>>
>>>>> git push -f
>>>>
>>>> The ASF server will probably block history rewrite.
>>>>
>>>
>>> It works...So I have fixed the wrong encoding log message..
>>
>> You were lucky because no one pulled yet from and if someone did and
>> pushed again, that would be a pain.
> I know about the risks I took...;-(...
>
> But would be the "better" way to fix such issue ?  Do you know a better
> one?

 From the top of my head, I would create an empty commit with a fixed 
message refencing the SHA1 which was fixed.

M


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Michael,

On 8/6/16 8:20 PM, Michael Osipov wrote:
> Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
>> Hi Michael,
>>
>> On 8/6/16 7:46 PM, Michael Osipov wrote:
>>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>>> Hi,
>>>>
>>>> I have accidently committed a change in Git with a log message which
>>>> contains wrongly encoded characters...
>>>>
>>>> What is the best to handle this?
>>>>
>>>> git commit --amend ..
>>>>
>>>> and
>>>>
>>>> git push -f
>>>
>>> The ASF server will probably block history rewrite.
>>>
>>
>> It works...So I have fixed the wrong encoding log message..
>
> You were lucky because no one pulled yet from and if someone did and
> pushed again, that would be a pain.
I know about the risks I took...;-(...

But would be the "better" way to fix such issue ?  Do you know a better one?

Kind regards
Karl Heinz


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-08-06 um 20:01 schrieb Karl Heinz Marbaise:
> Hi Michael,
>
> On 8/6/16 7:46 PM, Michael Osipov wrote:
>> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>>> Hi,
>>>
>>> I have accidently committed a change in Git with a log message which
>>> contains wrongly encoded characters...
>>>
>>> What is the best to handle this?
>>>
>>> git commit --amend ..
>>>
>>> and
>>>
>>> git push -f
>>
>> The ASF server will probably block history rewrite.
>>
>
> It works...So I have fixed the wrong encoding log message..

You were lucky because no one pulled yet from and if someone did and 
pushed again, that would be a pain.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi Michael,

On 8/6/16 7:46 PM, Michael Osipov wrote:
> Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
>> Hi,
>>
>> I have accidently committed a change in Git with a log message which
>> contains wrongly encoded characters...
>>
>> What is the best to handle this?
>>
>> git commit --amend ..
>>
>> and
>>
>> git push -f
>
> The ASF server will probably block history rewrite.
>

It works...So I have fixed the wrong encoding log message..


Kind regards
Karl Heinz


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Git Commit log with wrong encoding

Posted by Michael Osipov <mi...@apache.org>.
Am 2016-08-06 um 19:38 schrieb Karl Heinz Marbaise:
> Hi,
>
> I have accidently committed a change in Git with a log message which
> contains wrongly encoded characters...
>
> What is the best to handle this?
>
> git commit --amend ..
>
> and
>
> git push -f

The ASF server will probably block history rewrite.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org