{"thread":{"id":"37681","subject":"configure names for temporary files","startedAt":"2014-10-07T14:33:16Z","lastAt":"2014-10-10T14:39:21Z","messageCount":4,"participants":["Sergio Ferrero","David Aguilar","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"250284","messageId":"CALpL35mjtg9ge321Vz_kS1wzbYz+z9H5R3L8FcpVSNO3AtZzVA@mail.gmail.com","threadId":"37681","inReplyTo":null,"subject":"configure names for temporary files","fromName":"Sergio Ferrero","fromEmail":"sferrero@ensoftcorp.com","sentAt":"2014-10-07T14:33:16Z","receivedAt":"2014-10-07T14:33:16Z","isPatch":false,"sender":{"key":"sferrero@ensoftcorp.com","avatar":null},"body":"Hello,\n\nI'd like to configure git with a specific merge tool to merge Simulink\nmodel files.\nI have followed the steps to configure the merge tool successfully.\n\nI typed the following on Git Bash:\n\n   git config --system mergetool.<merge_tool_name>.cmd '\"<merge_tool_path>\"\n-base \"$BASE\" -local \"$LOCAL\" -remote \"$REMOTE\" -merged \"$MERGED\"'\n\nwhere:\n\n   - <merge_tool_name> is the name of the specific merge tool\n   - <merge_tool_path> is the full path to the .exe file for the merge tool\n   - the merge tool accepts the -base, -local, -remote and -merged arguments\n\n\nThen, after a merge detects conflicts on a Simulink model, I run the\nfollowing command on the Git Bash:\n\n   git mergetool -t <merge_tool_name> <model_name>.mdl\n\n\nThis command properly launches the GUI of the merge tool, however it\nindicates that provided file names are invalid. They are of the form:\n<model_name>.mdl.<revision>.#.mdl,\nwhere <revision> is either LOCAL, REMOTE or BASE and # is a number.\n\nThe merge tool needs to open the model in MATLAB and MATLAB does not allow\nopening models with '.' in their names.\n\nThus, is there a way to configure Git so that temporary models are of the\nform <model_name>_mdl_<revision>_#.mdl instead of <\nmodel_name>.mdl.<revision>.#.mdl?\n\nOther temp file name should also be ok as long as the file does not\ncontains dots in the part that corresponds to the file name.\n\nThanks in advance,\nSergio\n"},{"id":"250339","messageId":"20141008082228.GA78852@gmail.com","threadId":"37681","inReplyTo":"CALpL35mjtg9ge321Vz_kS1wzbYz+z9H5R3L8FcpVSNO3AtZzVA@mail.gmail.com","subject":"Re: configure names for temporary files","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-10-08T08:22:30Z","receivedAt":"2014-10-08T08:22:30Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Oct 07, 2014 at 11:33:16AM -0300, Sergio Ferrero wrote:\n> Hello,\n> \n> I'd like to configure git with a specific merge tool to merge Simulink\n> model files.\n> I have followed the steps to configure the merge tool successfully.\n> \n> I typed the following on Git Bash:\n> \n>    git config --system mergetool.<merge_tool_name>.cmd '\"<merge_tool_path>\"\n> -base \"$BASE\" -local \"$LOCAL\" -remote \"$REMOTE\" -merged \"$MERGED\"'\n> \n> where:\n> \n>    - <merge_tool_name> is the name of the specific merge tool\n>    - <merge_tool_path> is the full path to the .exe file for the merge tool\n>    - the merge tool accepts the -base, -local, -remote and -merged arguments\n> \n> \n> Then, after a merge detects conflicts on a Simulink model, I run the\n> following command on the Git Bash:\n> \n>    git mergetool -t <merge_tool_name> <model_name>.mdl\n> \n> \n> This command properly launches the GUI of the merge tool, however it\n> indicates that provided file names are invalid. They are of the form:\n> <model_name>.mdl.<revision>.#.mdl,\n> where <revision> is either LOCAL, REMOTE or BASE and # is a number.\n> \n> The merge tool needs to open the model in MATLAB and MATLAB does not allow\n> opening models with '.' in their names.\n> \n> Thus, is there a way to configure Git so that temporary models are of the\n> form <model_name>_mdl_<revision>_#.mdl instead of <\n> model_name>.mdl.<revision>.#.mdl?\n\nNo such option exists.\n\nIn theory you could come up with a way to make this configurable.\nA configuration variable could define a file pattern, for example.\n\nThe downside is making it configurable means supporting some\nmicro-format and the implementation would probably be ugly and\nrequire eval. I don't think it needs to be configurable.\n\nRight now the code flow is roughly:\n\n\tMERGED=foo/bar.baz\n\n\text=\"$$$(expr \"$MERGED\" : '.*\\(\\.[^/]*\\)$')\"\n\tBACKUP=\"./$MERGED.BACKUP.$ext\"\n\tLOCAL=\"./$MERGED.LOCAL.$ext\"\n\tREMOTE=\"./$MERGED.REMOTE.$ext\"\n\tBASE=\"./$MERGED.BASE.$ext\"\n\nThis results in a path that looks like:\n\n\t./foo/bar.baz.BASE.81001.baz\n\nI think we can do better by default.\nA more conservative result would something like:\n\n\t./foo/bar_BASE_81001.baz\n\nConsequently, matlab (and perhaps other overly-picky tools) are\nmore likely to accept this path since it fits into their\nwindows-esque worldview where filenames can have at most 1 dot.\n\nYou should also email matlab support and kindly ask them to fix\ntheir buggy software! ;-P foo.bar.baz is a perfectly valid\nfilename.\n\nIn any case, it might be worth adjusting mergetool to use a more\nconservative path (underscores instead of dots) since there\ndoesn't seem to be much downside to doing so.\n-- \nDavid\n"},{"id":"250363","messageId":"xmqqtx3ebhip.fsf@gitster.dls.corp.google.com","threadId":"37681","inReplyTo":"20141008082228.GA78852@gmail.com","subject":"Re: configure names for temporary files","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-10-08T17:25:34Z","receivedAt":"2014-10-08T17:25:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Aguilar <davvid@gmail.com> writes:\n\n> In any case, it might be worth adjusting mergetool to use a more\n> conservative path (underscores instead of dots) since there\n> doesn't seem to be much downside to doing so.\n\nHopefully there won't be tools that reject paths with \"_\" in them\n;-)\n"},{"id":"250485","messageId":"CALpL35nPE+MxSKNc3cRyAbNW3SBz50EGu7P6cF+PcA-vky7jXg@mail.gmail.com","threadId":"37681","inReplyTo":"xmqqtx3ebhip.fsf@gitster.dls.corp.google.com","subject":"Re: configure names for temporary files","fromName":"Sergio Ferrero","fromEmail":"sferrero@ensoftcorp.com","sentAt":"2014-10-10T14:39:21Z","receivedAt":"2014-10-10T14:39:21Z","isPatch":false,"sender":{"key":"sferrero@ensoftcorp.com","avatar":null},"body":"Ok. thanks!\nDavid: I'm pretty sure matlab won't do that change soon :)\n\nSergio\n\nOn Wed, Oct 8, 2014 at 2:25 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> David Aguilar <davvid@gmail.com> writes:\n>\n>> In any case, it might be worth adjusting mergetool to use a more\n>> conservative path (underscores instead of dots) since there\n>> doesn't seem to be much downside to doing so.\n>\n> Hopefully there won't be tools that reject paths with \"_\" in them\n> ;-)\n"}]}