git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-rebase is ignoring working-tree-encoding

From
Torsten Bögershausen <tboegi@web.de>
Date
Nov 6, 2018, 20:16 UTC
Message-ID
<20181106201618.GA30158@tor.lan>
In-Reply-To
<20181105181014.GA30777@tor.lan>
On Mon, Nov 05, 2018 at 07:10:14PM +0100, Torsten Bögershausen wrote:
Show 16 quoted lines
> On Mon, Nov 05, 2018 at 05:24:39AM +0100, Adrián Gimeno Balaguer wrote:
> 
> []
> 
> > https://github.com/git/git/pull/550
>  
> []
>  
> > This is covered in the mentioned PR above. Thanks for feedback.
> 
> Thanks for the code,
> I will have a look (the next days)
> 
> > 
> > -- 
> > Adrián
Hej Adrián,

I still didn't manage to fully understand your problem. I tried to convert your test into my understanding, It can be fetched here (or copied from this message, see below)

https://github.com/tboegi/git/tree/tb.181106_UTF16LE_commit

The commit of an empty file seems to work for me, in the initial report a "rebase" was mentioned, which is not in the TC ?

Is the following what you intended to test ?

#!/bin/sh test_description='UTF-16 LE/BE file encoding using working-tree-encoding'

. ./test-lib.sh

# We specify the UTF-16LE BOM manually, to not depend on programs such as iconv. utf16leBOM=$(printf '\377\376')

test_expect_success 'Stage empty UTF-16LE file as binary' '
	>empty_0.txt &&
	echo "empty_0.txt binary" >>.gitattributes &&
	git add empty_0.txt
'
test_expect_success 'Stage empty file with enc=UTF.16BL' '
	>utf16le_0.txt &&
	echo "utf16le_0.txt text working-tree-encoding=UTF-16BE" >>.gitattributes &&
	git add utf16le_0.txt
'
test_expect_success 'Create and stage UTF-16LE file with only BOM' '
	printf "$utf16leBOM" >utf16le_1.txt &&
	echo "utf16le_1.txt text working-tree-encoding=UTF-16" >>.gitattributes &&
	git add utf16le_1.txt
'
test_expect_success 'Dont stage UTF-16LE file with only BOM with enc=UTF.16BE' '
	printf "$utf16leBOM" >utf16le_2.txt &&
	echo "utf16le_2.txt text working-tree-encoding=UTF-16BE" >>.gitattributes &&
	test_must_fail git add utf16le_2.txt
'
test_expect_success 'commit all files' '
	test_tick &&
	git commit -m "Commit all 3 files"
'
test_expect_success 'All commited files have the same sha' '
	git ls-files -s --eol >tmp1 &&
	sed -e "s!	i/none.*!!" <tmp1 | uniq -u >actual &&
	>expect &&
	test_cmp expect actual
'
test_done
Previous: Torsten BögershausenNext: Adrián Gimeno Balaguer
Message 8 of 25 in “git-rebase is ignoring working-tree-encoding”
  1. Adrián Gimeno BalaguerNov 2, 2018
  2. brian m. carlsonNov 4, 2018
  3. Adrián Gimeno BalaguerNov 4, 2018
  4. brian m. carlsonNov 4, 2018
  5. Torsten BögershausenNov 4, 2018
  6. Adrián Gimeno BalaguerNov 5, 2018
  7. Torsten BögershausenNov 5, 2018
  8. Torsten BögershausenNov 6, 2018
  9. Adrián Gimeno BalaguerNov 7, 2018
  10. Torsten BögershausenNov 8, 2018
  11. Alexandre GrigorievDec 26, 2018
  12. brian m. carlsonDec 26, 2018
  13. Alexandre GrigorievDec 27, 2018
  14. Torsten BögershausenDec 27, 2018
  15. Alexandre GrigorievDec 23, 2018
  16. 1/1 Support working-tree-encoding "UTF-16LE-BOM"tboegi@web.de, Dec 29, 2018
  17. 1/1 Support working-tree-encoding "UTF-16LE-BOM"tboegi@web.de, Jan 20, 2019
  18. Junio C HamanoJan 22, 2019
  19. 1/1 Support working-tree-encoding "UTF-16LE-BOM"tboegi@web.de, Jan 30, 2019
  20. Jason PyeronJan 30, 2019
  21. Torsten BögershausenJan 30, 2019
  22. 1/1 gitattributes.txt: fix typotboegi@web.de, Mar 6, 2019
  23. Junio C HamanoMar 7, 2019
  24. Adrián Gimeno BalaguerDec 29, 2018
  25. Philip OakleyDec 29, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.