{"thread":{"id":"41334","subject":"Merging branches with smudge filter","startedAt":"2016-02-04T23:10:37Z","lastAt":"2016-02-09T09:15:12Z","messageCount":4,"participants":["Leonardo","Junio C Hamano","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"277482","messageId":"CACqLfMk_qDhbXUjWLtBLP4o=CeKEgaWAm881h03fneuiRO-v2w@mail.gmail.com","threadId":"41334","inReplyTo":null,"subject":"Merging branches with smudge filter","fromName":"Leonardo","fromEmail":"leobasilio@gmail.com","sentAt":"2016-02-04T23:10:37Z","receivedAt":"2016-02-04T23:10:37Z","isPatch":false,"sender":{"key":"leobasilio@gmail.com","avatar":null},"body":"Hi, everybody. I'm new to git and I'd like to keep track of some codes\nwe have here in our company. They have some sensitive information I\nwould like to keep private. After some googling, I found some\nsolutions that encrypt/decrypt the files using filters as they're\ncommitted/checked out. I've been using this approach and it suits my\nneeds. Now I need to merge two branches, but the process is failing\nfor two files in particular. First of all, here's my config file:\n\n[filter \"openssl\"]\n    clean = openssl enc -aes-256-cbc -a -nosalt -pass pass:password\n    smudge = openssl enc -d -aes-256-cbc -a -nosalt -pass pass:password\n    required\n\nFor these two files I mentioned, decryption fails. Then I did this:\n\n    smudge = openssl enc -d -aes-256-cbc -a -nosalt -pass\npass:password || tee -a /out.txt\n\nBased on the output, it seems like the input data is corrupted, but I\ndon't get it. These files are regular source code like any other file.\nI can also check out both branches individually, so I'm assuming the\nstored blob is fine. Every other file is perfectly merged. What should\nI do?\n\nThank you.\n"},{"id":"277746","messageId":"xmqqbn7r9kfz.fsf@gitster.mtv.corp.google.com","threadId":"41334","inReplyTo":"CACqLfMk_qDhbXUjWLtBLP4o=CeKEgaWAm881h03fneuiRO-v2w@mail.gmail.com","subject":"Re: Merging branches with smudge filter","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-08T17:32:48Z","receivedAt":"2016-02-08T17:32:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Leonardo <leobasilio@gmail.com> writes:\n\n> Hi, everybody. I'm new to git and I'd like to keep track of some codes\n> we have here in our company. They have some sensitive information I\n> would like to keep private. After some googling, I found some\n> solutions that encrypt/decrypt the files using filters as they're\n> committed/checked out. I've been using this approach and it suits my\n> needs. Now I need to merge two branches, but the process is failing\n> for two files in particular. First of all, here's my config file:\n>\n> [filter \"openssl\"]\n>     clean = openssl enc -aes-256-cbc -a -nosalt -pass pass:password\n>     smudge = openssl enc -d -aes-256-cbc -a -nosalt -pass pass:password\n>     required\n\nGit works on the \"clean\" representation of the data, i.e. the\nrepresentation of the blob object stored in the object database and\nin the index, when manipulating the contents, e.g. diffing two\nvariants, patching (think \"add -p\"), merging, etc.\n\nAs you are making the \"clean\" version an encrypted opaque sequence\nof bytes, it is expected that you wouldn't be able to run 3-way\nmerges.\n"},{"id":"277747","messageId":"CACqLfM=G-=kD+wnDG-oWz4-eKW1ET_vnsenEXdCDwRsv0YXcSA@mail.gmail.com","threadId":"41334","inReplyTo":"xmqqbn7r9kfz.fsf@gitster.mtv.corp.google.com","subject":"Re: Merging branches with smudge filter","fromName":"Leonardo","fromEmail":"leobasilio@gmail.com","sentAt":"2016-02-08T17:52:36Z","receivedAt":"2016-02-08T17:52:36Z","isPatch":false,"sender":{"key":"leobasilio@gmail.com","avatar":null},"body":"Hi. I understand what you mean, but if that's the case, I don't get\nhow every file was merged successfully despite the encryption, except\ntwo of them. I thought the smudge filter was supposed to be applied to\nevery blob before any git operation, thus exposing the clean source\ncode. Well, in the end I've merged these two files manually. I think I\nmight have done something wrong while branching. I'm still learning.\nNext time I'll be more attentive.\n\n2016-02-08 15:32 GMT-02:00 Junio C Hamano <gitster@pobox.com>:\n> Leonardo <leobasilio@gmail.com> writes:\n>\n>> Hi, everybody. I'm new to git and I'd like to keep track of some codes\n>> we have here in our company. They have some sensitive information I\n>> would like to keep private. After some googling, I found some\n>> solutions that encrypt/decrypt the files using filters as they're\n>> committed/checked out. I've been using this approach and it suits my\n>> needs. Now I need to merge two branches, but the process is failing\n>> for two files in particular. First of all, here's my config file:\n>>\n>> [filter \"openssl\"]\n>>     clean = openssl enc -aes-256-cbc -a -nosalt -pass pass:password\n>>     smudge = openssl enc -d -aes-256-cbc -a -nosalt -pass pass:password\n>>     required\n>\n> Git works on the \"clean\" representation of the data, i.e. the\n> representation of the blob object stored in the object database and\n> in the index, when manipulating the contents, e.g. diffing two\n> variants, patching (think \"add -p\"), merging, etc.\n>\n> As you are making the \"clean\" version an encrypted opaque sequence\n> of bytes, it is expected that you wouldn't be able to run 3-way\n> merges.\n"},{"id":"277795","messageId":"56B9AE20.70905@drmicha.warpmail.net","threadId":"41334","inReplyTo":"CACqLfM=G-=kD+wnDG-oWz4-eKW1ET_vnsenEXdCDwRsv0YXcSA@mail.gmail.com","subject":"Re: Merging branches with smudge filter","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2016-02-09T09:15:12Z","receivedAt":"2016-02-09T09:15:12Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"[Please bottom-reply on this list]\nLeonardo venit, vidit, dixit 08.02.2016 18:52:\n> Hi. I understand what you mean, but if that's the case, I don't get\n> how every file was merged successfully despite the encryption, except\n> two of them. I thought the smudge filter was supposed to be applied to\n> every blob before any git operation, thus exposing the clean source\n> code. Well, in the end I've merged these two files manually. I think I\n> might have done something wrong while branching. I'm still learning.\n> Next time I'll be more attentive.\n\nSimple rule with filters:\n\"cleaned\" is what is stored in the repo (as blobs)\n\"smudged\" is what you see in your files in the working tree\n\nNow, if Git is asked to merge two revisions and some blobs were not\nchanged at all, or only by one side of the merge, these parts of the\nmerge can be resolved trivially.\n\nThe others can't. You may want to try merge tools, or even a custom\nmerge driver (see git-merge man page).\n\nMichael\n\n> 2016-02-08 15:32 GMT-02:00 Junio C Hamano <gitster@pobox.com>:\n>> Leonardo <leobasilio@gmail.com> writes:\n>>\n>>> Hi, everybody. I'm new to git and I'd like to keep track of some codes\n>>> we have here in our company. They have some sensitive information I\n>>> would like to keep private. After some googling, I found some\n>>> solutions that encrypt/decrypt the files using filters as they're\n>>> committed/checked out. I've been using this approach and it suits my\n>>> needs. Now I need to merge two branches, but the process is failing\n>>> for two files in particular. First of all, here's my config file:\n>>>\n>>> [filter \"openssl\"]\n>>>     clean = openssl enc -aes-256-cbc -a -nosalt -pass pass:password\n>>>     smudge = openssl enc -d -aes-256-cbc -a -nosalt -pass pass:password\n>>>     required\n>>\n>> Git works on the \"clean\" representation of the data, i.e. the\n>> representation of the blob object stored in the object database and\n>> in the index, when manipulating the contents, e.g. diffing two\n>> variants, patching (think \"add -p\"), merging, etc.\n>>\n>> As you are making the \"clean\" version an encrypted opaque sequence\n>> of bytes, it is expected that you wouldn't be able to run 3-way\n>> merges.\n"}]}