{"thread":{"id":"16016","subject":"how to configure Git to treat certain type of ascii files as binary files","startedAt":"2008-10-22T21:58:28Z","lastAt":"2008-10-23T01:12:50Z","messageCount":6,"participants":["Weiwei Shu","david@lang.hm","David Symonds","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"93735","messageId":"65d12cb10810221458j14ef0009u679cdb0f73299d7f@mail.gmail.com","threadId":"16016","inReplyTo":null,"subject":"how to configure Git to treat certain type of ascii files as binary files","fromName":"Weiwei Shu","fromEmail":"shuww1980@gmail.com","sentAt":"2008-10-22T21:58:28Z","receivedAt":"2008-10-22T21:58:28Z","isPatch":false,"sender":{"key":"shuww1980@gmail.com","avatar":null},"body":"Hello everyone,\n\nMy first post in this mailing list. Could some one direct me to some\ndocument/manual pages to setup Git to treat ascii files as binary\nfiles? I'm using Git to do circuit schematics (SPICE files)\nversioning. I will not do any merging or editing stuff with external\neditors. The only way to change it is to use schematic capture GUIs\n(Cadence, ADS, etc). So I'd like to treat them as binary files to\nreduce the possibilities of messing them up.\n\nI know it seems a little bit stupid to use Git to do such an easy job.\nBut hey, it's the most eye-catching SCM software, isn't it?\n\n\n\n-- \nWeiwei\n--Hope Springs Eternal.\n"},{"id":"93737","messageId":"alpine.DEB.1.10.0810221511590.24463@asgard.lang.hm","threadId":"16016","inReplyTo":"65d12cb10810221458j14ef0009u679cdb0f73299d7f@mail.gmail.com","subject":"Re: how to configure Git to treat certain type of ascii files as binary files","fromName":"","fromEmail":"david@lang.hm","sentAt":"2008-10-22T22:13:07Z","receivedAt":"2008-10-22T22:13:07Z","isPatch":false,"sender":{"key":"david@lang.hm","avatar":null},"body":"On Wed, 22 Oct 2008, Weiwei Shu wrote:\n\n> Hello everyone,\n>\n> My first post in this mailing list. Could some one direct me to some\n> document/manual pages to setup Git to treat ascii files as binary\n> files? I'm using Git to do circuit schematics (SPICE files)\n> versioning. I will not do any merging or editing stuff with external\n> editors. The only way to change it is to use schematic capture GUIs\n> (Cadence, ADS, etc). So I'd like to treat them as binary files to\n> reduce the possibilities of messing them up.\n>\n> I know it seems a little bit stupid to use Git to do such an easy job.\n> But hey, it's the most eye-catching SCM software, isn't it?\n\nunless you enable cr/lf handling git won't change ascii files.\n\nwhat is it that you think needs to be done differently for these files \nthan for any other files?\n\nDavid Lang\n"},{"id":"93738","messageId":"ee77f5c20810221513td0b9620n4a7692dcc966e962@mail.gmail.com","threadId":"16016","inReplyTo":"65d12cb10810221458j14ef0009u679cdb0f73299d7f@mail.gmail.com","subject":"Re: how to configure Git to treat certain type of ascii files as binary files","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-10-22T22:13:13Z","receivedAt":"2008-10-22T22:13:13Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Wed, Oct 22, 2008 at 2:58 PM, Weiwei Shu <shuww1980@gmail.com> wrote:\n\n> My first post in this mailing list. Could some one direct me to some\n> document/manual pages to setup Git to treat ascii files as binary\n> files? I'm using Git to do circuit schematics (SPICE files)\n> versioning. I will not do any merging or editing stuff with external\n> editors. The only way to change it is to use schematic capture GUIs\n> (Cadence, ADS, etc). So I'd like to treat them as binary files to\n> reduce the possibilities of messing them up.\n\nGit doesn't futz with your file contents unless you explicitly ask it\nto, such as the CRLF-munging stuff. By default, all files are\n\"binary\".\n\n\nDave.\n"},{"id":"93739","messageId":"65d12cb10810221535l235490b9ifc39738c0cde5f4d@mail.gmail.com","threadId":"16016","inReplyTo":"alpine.DEB.1.10.0810221511590.24463@asgard.lang.hm","subject":"Re: how to configure Git to treat certain type of ascii files as binary files","fromName":"Weiwei Shu","fromEmail":"shuww1980@gmail.com","sentAt":"2008-10-22T22:35:21Z","receivedAt":"2008-10-22T22:35:21Z","isPatch":false,"sender":{"key":"shuww1980@gmail.com","avatar":null},"body":"Thanks David.\n\nWell, for binary files, SCM tools (like subversion) usually work as\n\"lock-modify-unlock\" mode in which merging is not supported since the\nfiles are not human-readable. The schematics are ascii files, but I do\nnot want them to be merged if I run \"merge\" command. Instead I'd like\nGit ask me to \"look-and-replace\". I know Git is not meant to do this\nkind of jobs. Just curious if it is able to be configured to work in\nthat way.\n\n\n\nOn Wed, Oct 22, 2008 at 5:13 PM,  <david@lang.hm> wrote:\n> On Wed, 22 Oct 2008, Weiwei Shu wrote:\n>\n>> Hello everyone,\n>>\n>> My first post in this mailing list. Could some one direct me to some\n>> document/manual pages to setup Git to treat ascii files as binary\n>> files? I'm using Git to do circuit schematics (SPICE files)\n>> versioning. I will not do any merging or editing stuff with external\n>> editors. The only way to change it is to use schematic capture GUIs\n>> (Cadence, ADS, etc). So I'd like to treat them as binary files to\n>> reduce the possibilities of messing them up.\n>>\n>> I know it seems a little bit stupid to use Git to do such an easy job.\n>> But hey, it's the most eye-catching SCM software, isn't it?\n>\n> unless you enable cr/lf handling git won't change ascii files.\n>\n> what is it that you think needs to be done differently for these files than\n> for any other files?\n>\n> David Lang\n>\n\n\n\n-- \nWeiwei\n--Hope Springs Eternal.\n"},{"id":"93740","messageId":"m3hc74i73a.fsf@localhost.localdomain","threadId":"16016","inReplyTo":"65d12cb10810221458j14ef0009u679cdb0f73299d7f@mail.gmail.com","subject":"Re: how to configure Git to treat certain type of ascii files as binary files","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-10-22T22:40:55Z","receivedAt":"2008-10-22T22:40:55Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Weiwei Shu\" <shuww1980@gmail.com> writes:\n\n> My first post in this mailing list. Could some one direct me to some\n> document/manual pages to setup Git to treat ascii files as binary\n> files? I'm using Git to do circuit schematics (SPICE files)\n> versioning. I will not do any merging or editing stuff with external\n> editors. The only way to change it is to use schematic capture GUIs\n> (Cadence, ADS, etc). So I'd like to treat them as binary files to\n> reduce the possibilities of messing them up.\n> \n> I know it seems a little bit stupid to use Git to do such an easy job.\n> But hey, it's the most eye-catching SCM software, isn't it?\n\nFirst, git does not modify files unless you have core.crlf set,\nand even then it warns about irreversible transformations\n(core.safecrlf)\n\nSecond, using gitattributes you can set diff driver and merge driver;\none of possibilities is to treat file as binary (binary diff and no\nusing 3-way file merge).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"93752","messageId":"65d12cb10810221812n692f83fl3b822568384f3f34@mail.gmail.com","threadId":"16016","inReplyTo":"m3hc74i73a.fsf@localhost.localdomain","subject":"Re: how to configure Git to treat certain type of ascii files as binary files","fromName":"Weiwei Shu","fromEmail":"shuww1980@gmail.com","sentAt":"2008-10-23T01:12:50Z","receivedAt":"2008-10-23T01:12:50Z","isPatch":false,"sender":{"key":"shuww1980@gmail.com","avatar":null},"body":"Thanks Jakub. I'll read its manual and try to play with it. Thank all\nfor replies!\n\nOn Wed, Oct 22, 2008 at 5:40 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> \"Weiwei Shu\" <shuww1980@gmail.com> writes:\n>\n>> My first post in this mailing list. Could some one direct me to some\n>> document/manual pages to setup Git to treat ascii files as binary\n>> files? I'm using Git to do circuit schematics (SPICE files)\n>> versioning. I will not do any merging or editing stuff with external\n>> editors. The only way to change it is to use schematic capture GUIs\n>> (Cadence, ADS, etc). So I'd like to treat them as binary files to\n>> reduce the possibilities of messing them up.\n>>\n>> I know it seems a little bit stupid to use Git to do such an easy job.\n>> But hey, it's the most eye-catching SCM software, isn't it?\n>\n> First, git does not modify files unless you have core.crlf set,\n> and even then it warns about irreversible transformations\n> (core.safecrlf)\n>\n> Second, using gitattributes you can set diff driver and merge driver;\n> one of possibilities is to treat file as binary (binary diff and no\n> using 3-way file merge).\n>\n> --\n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n>\n\n\n\n-- \nWeiwei\n--Hope Springs Eternal.\n"}]}