{"thread":{"id":"44731","subject":"[PATCH v1] git-p4: add diff/merge properties to .gitattributes for GitLFS files","startedAt":"2016-12-18T19:02:09Z","lastAt":"2016-12-20T11:09:47Z","messageCount":3,"participants":["larsxschneider@gmail.com","Junio C Hamano","Luke Diamand"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"307999","messageId":"20161218190140.3732-1-larsxschneider@gmail.com","threadId":"44731","inReplyTo":null,"subject":"[PATCH v1] git-p4: add diff/merge properties to .gitattributes for GitLFS files","fromName":"","fromEmail":"larsxschneider@gmail.com","sentAt":"2016-12-18T19:01:40Z","receivedAt":"2016-12-18T19:02:09Z","isPatch":true,"sender":{"key":"larsxschneider@gmail.com","avatar":"https://avatars.githubusercontent.com/u/477434?v=4"},"body":"From: Lars Schneider <larsxschneider@gmail.com>\n\nThe `git lfs track` command generates a .gitattributes file with diff\nand merge properties [1]. Set the same .gitattributes format for files\ntracked with GitLFS in git-p4.\n\n[1] https://github.com/git-lfs/git-lfs/blob/v1.5.3/commands/command_track.go#L121\n\nSigned-off-by: Lars Schneider <larsxschneider@gmail.com>\n---\n\nNotes:\n    Base Commit: d1271bddd4 (v2.11.0)\n    Diff on Web: https://github.com/git/git/compare/d1271bddd4...larsxschneider:e045b3d5c8\n    Checkout:    git fetch https://github.com/larsxschneider/git git-p4/fix-lfs-attributes-v1 && git checkout e045b3d5c8\n\n git-p4.py                 |  4 ++--\n t/t9824-git-p4-git-lfs.sh | 24 ++++++++++++------------\n 2 files changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex fd5ca52462..87b6932c81 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1098,10 +1098,10 @@ class GitLFS(LargeFileSystem):\n                 '# Git LFS (see https://git-lfs.github.com/)\\n',\n                 '#\\n',\n             ] +\n-            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n+            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n                 for f in sorted(gitConfigList('git-p4.largeFileExtensions'))\n             ] +\n-            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n+            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n                 for f in sorted(self.largeFiles) if not self.hasLargeFileExtension(f)\n             ]\n         )\ndiff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\nindex 110a7e7924..1379db6357 100755\n--- a/t/t9824-git-p4-git-lfs.sh\n+++ b/t/t9824-git-p4-git-lfs.sh\n@@ -81,9 +81,9 @@ test_expect_success 'Store files in LFS based on size (>24 bytes)' '\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t/file2.dat filter=lfs -text\n-\t\t/file4.bin filter=lfs -text\n-\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n+\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n+\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n+\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -109,7 +109,7 @@ test_expect_success 'Store files in LFS based on size (>25 bytes)' '\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t/file4.bin filter=lfs -text\n+\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -135,7 +135,7 @@ test_expect_success 'Store files in LFS based on extension (dat)' '\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t*.dat filter=lfs -text\n+\t\t*.dat filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -163,8 +163,8 @@ test_expect_success 'Store files in LFS based on size (>25 bytes) and extension\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t*.dat filter=lfs -text\n-\t\t/file4.bin filter=lfs -text\n+\t\t*.dat filter=lfs diff=lfs merge=lfs -text\n+\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -199,8 +199,8 @@ test_expect_success 'Remove file from repo and store files in LFS based on size\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t/file2.dat filter=lfs -text\n-\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n+\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n+\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -237,8 +237,8 @@ test_expect_success 'Add .gitattributes and store files in LFS based on size (>2\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t/file2.dat filter=lfs -text\n-\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n+\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n+\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n@@ -278,7 +278,7 @@ test_expect_success 'Add big files to repo and store files in LFS based on compr\n \t\t#\n \t\t# Git LFS (see https://git-lfs.github.com/)\n \t\t#\n-\t\t/file6.bin filter=lfs -text\n+\t\t/file6.bin filter=lfs diff=lfs merge=lfs -text\n \t\tEOF\n \t\ttest_path_is_file .gitattributes &&\n \t\ttest_cmp expect .gitattributes\n-- \n2.11.0\n\n"},{"id":"308098","messageId":"xmqqy3zbmwu5.fsf@gitster.mtv.corp.google.com","threadId":"44731","inReplyTo":"20161218190140.3732-1-larsxschneider@gmail.com","subject":"Re: [PATCH v1] git-p4: add diff/merge properties to .gitattributes for GitLFS files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-19T21:29:38Z","receivedAt":"2016-12-19T21:30:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"larsxschneider@gmail.com writes:\n\n> From: Lars Schneider <larsxschneider@gmail.com>\n>\n> The `git lfs track` command generates a .gitattributes file with diff\n> and merge properties [1]. Set the same .gitattributes format for files\n> tracked with GitLFS in git-p4.\n>\n> [1] https://github.com/git-lfs/git-lfs/blob/v1.5.3/commands/command_track.go#L121\n>\n> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>\n> ---\n\nThanks.  Luke, does this look ok?\n\n>\n> Notes:\n>     Base Commit: d1271bddd4 (v2.11.0)\n>     Diff on Web: https://github.com/git/git/compare/d1271bddd4...larsxschneider:e045b3d5c8\n>     Checkout:    git fetch https://github.com/larsxschneider/git git-p4/fix-lfs-attributes-v1 && git checkout e045b3d5c8\n>\n>  git-p4.py                 |  4 ++--\n>  t/t9824-git-p4-git-lfs.sh | 24 ++++++++++++------------\n>  2 files changed, 14 insertions(+), 14 deletions(-)\n>\n> diff --git a/git-p4.py b/git-p4.py\n> index fd5ca52462..87b6932c81 100755\n> --- a/git-p4.py\n> +++ b/git-p4.py\n> @@ -1098,10 +1098,10 @@ class GitLFS(LargeFileSystem):\n>                  '# Git LFS (see https://git-lfs.github.com/)\\n',\n>                  '#\\n',\n>              ] +\n> -            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n> +            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n>                  for f in sorted(gitConfigList('git-p4.largeFileExtensions'))\n>              ] +\n> -            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n> +            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n>                  for f in sorted(self.largeFiles) if not self.hasLargeFileExtension(f)\n>              ]\n>          )\n> diff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\n> index 110a7e7924..1379db6357 100755\n> --- a/t/t9824-git-p4-git-lfs.sh\n> +++ b/t/t9824-git-p4-git-lfs.sh\n> @@ -81,9 +81,9 @@ test_expect_success 'Store files in LFS based on size (>24 bytes)' '\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t/file2.dat filter=lfs -text\n> -\t\t/file4.bin filter=lfs -text\n> -\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n> +\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n> +\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n> +\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -109,7 +109,7 @@ test_expect_success 'Store files in LFS based on size (>25 bytes)' '\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t/file4.bin filter=lfs -text\n> +\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -135,7 +135,7 @@ test_expect_success 'Store files in LFS based on extension (dat)' '\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t*.dat filter=lfs -text\n> +\t\t*.dat filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -163,8 +163,8 @@ test_expect_success 'Store files in LFS based on size (>25 bytes) and extension\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t*.dat filter=lfs -text\n> -\t\t/file4.bin filter=lfs -text\n> +\t\t*.dat filter=lfs diff=lfs merge=lfs -text\n> +\t\t/file4.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -199,8 +199,8 @@ test_expect_success 'Remove file from repo and store files in LFS based on size\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t/file2.dat filter=lfs -text\n> -\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n> +\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n> +\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -237,8 +237,8 @@ test_expect_success 'Add .gitattributes and store files in LFS based on size (>2\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t/file2.dat filter=lfs -text\n> -\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n> +\t\t/file2.dat filter=lfs diff=lfs merge=lfs -text\n> +\t\t/path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n> @@ -278,7 +278,7 @@ test_expect_success 'Add big files to repo and store files in LFS based on compr\n>  \t\t#\n>  \t\t# Git LFS (see https://git-lfs.github.com/)\n>  \t\t#\n> -\t\t/file6.bin filter=lfs -text\n> +\t\t/file6.bin filter=lfs diff=lfs merge=lfs -text\n>  \t\tEOF\n>  \t\ttest_path_is_file .gitattributes &&\n>  \t\ttest_cmp expect .gitattributes\n"},{"id":"308139","messageId":"CAE5ih79CyeEM0DZXBmrY6tSVD6Y-iMY0Wc6d8Wm1e=rT2zY-yQ@mail.gmail.com","threadId":"44731","inReplyTo":"xmqqy3zbmwu5.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v1] git-p4: add diff/merge properties to .gitattributes for GitLFS files","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2016-12-20T11:09:41Z","receivedAt":"2016-12-20T11:09:47Z","isPatch":true,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 19 December 2016 at 21:29, Junio C Hamano <gitster@pobox.com> wrote:\n> larsxschneider@gmail.com writes:\n>\n>> From: Lars Schneider <larsxschneider@gmail.com>\n>>\n>> The `git lfs track` command generates a .gitattributes file with diff\n>> and merge properties [1]. Set the same .gitattributes format for files\n>> tracked with GitLFS in git-p4.\n>>\n>> [1] https://github.com/git-lfs/git-lfs/blob/v1.5.3/commands/command_track.go#L121\n>>\n>> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>\n>> ---\n>\n> Thanks.  Luke, does this look ok?\n\nYes, looks good to me.\n\nLuke\n\n\n>\n>>\n>> Notes:\n>>     Base Commit: d1271bddd4 (v2.11.0)\n>>     Diff on Web: https://github.com/git/git/compare/d1271bddd4...larsxschneider:e045b3d5c8\n>>     Checkout:    git fetch https://github.com/larsxschneider/git git-p4/fix-lfs-attributes-v1 && git checkout e045b3d5c8\n>>\n>>  git-p4.py                 |  4 ++--\n>>  t/t9824-git-p4-git-lfs.sh | 24 ++++++++++++------------\n>>  2 files changed, 14 insertions(+), 14 deletions(-)\n>>\n>> diff --git a/git-p4.py b/git-p4.py\n>> index fd5ca52462..87b6932c81 100755\n>> --- a/git-p4.py\n>> +++ b/git-p4.py\n>> @@ -1098,10 +1098,10 @@ class GitLFS(LargeFileSystem):\n>>                  '# Git LFS (see https://git-lfs.github.com/)\\n',\n>>                  '#\\n',\n>>              ] +\n>> -            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n>> +            ['*.' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n>>                  for f in sorted(gitConfigList('git-p4.largeFileExtensions'))\n>>              ] +\n>> -            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs -text\\n'\n>> +            ['/' + f.replace(' ', '[[:space:]]') + ' filter=lfs diff=lfs merge=lfs -text\\n'\n>>                  for f in sorted(self.largeFiles) if not self.hasLargeFileExtension(f)\n>>              ]\n>>          )\n>> diff --git a/t/t9824-git-p4-git-lfs.sh b/t/t9824-git-p4-git-lfs.sh\n>> index 110a7e7924..1379db6357 100755\n>> --- a/t/t9824-git-p4-git-lfs.sh\n>> +++ b/t/t9824-git-p4-git-lfs.sh\n>> @@ -81,9 +81,9 @@ test_expect_success 'Store files in LFS based on size (>24 bytes)' '\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             /file2.dat filter=lfs -text\n>> -             /file4.bin filter=lfs -text\n>> -             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n>> +             /file2.dat filter=lfs diff=lfs merge=lfs -text\n>> +             /file4.bin filter=lfs diff=lfs merge=lfs -text\n>> +             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -109,7 +109,7 @@ test_expect_success 'Store files in LFS based on size (>25 bytes)' '\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             /file4.bin filter=lfs -text\n>> +             /file4.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -135,7 +135,7 @@ test_expect_success 'Store files in LFS based on extension (dat)' '\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             *.dat filter=lfs -text\n>> +             *.dat filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -163,8 +163,8 @@ test_expect_success 'Store files in LFS based on size (>25 bytes) and extension\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             *.dat filter=lfs -text\n>> -             /file4.bin filter=lfs -text\n>> +             *.dat filter=lfs diff=lfs merge=lfs -text\n>> +             /file4.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -199,8 +199,8 @@ test_expect_success 'Remove file from repo and store files in LFS based on size\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             /file2.dat filter=lfs -text\n>> -             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n>> +             /file2.dat filter=lfs diff=lfs merge=lfs -text\n>> +             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -237,8 +237,8 @@ test_expect_success 'Add .gitattributes and store files in LFS based on size (>2\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             /file2.dat filter=lfs -text\n>> -             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs -text\n>> +             /file2.dat filter=lfs diff=lfs merge=lfs -text\n>> +             /path[[:space:]]with[[:space:]]spaces/file3.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n>> @@ -278,7 +278,7 @@ test_expect_success 'Add big files to repo and store files in LFS based on compr\n>>               #\n>>               # Git LFS (see https://git-lfs.github.com/)\n>>               #\n>> -             /file6.bin filter=lfs -text\n>> +             /file6.bin filter=lfs diff=lfs merge=lfs -text\n>>               EOF\n>>               test_path_is_file .gitattributes &&\n>>               test_cmp expect .gitattributes\n"}]}