{"thread":{"id":"9475","subject":"Relative alternates question","startedAt":"2007-08-10T16:45:56Z","lastAt":"2007-08-10T19:38:50Z","messageCount":2,"participants":["Jan Hudec","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50424","messageId":"20070810164556.GB3442@efreet.light.src","threadId":"9475","inReplyTo":null,"subject":"Relative alternates question","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-08-10T16:45:56Z","receivedAt":"2007-08-10T16:45:56Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"Hello,\n\nTrying to solve a problem with object/info/alternates and http (a rather\nproblematic combination) I noticed the following code in sha1_file.c:336 in\nfunction link_alt_odb_entries.\n(current master -- v1.5.3-rc4-41-g7efeb8f):\n\n                        if ((*last != '/') && depth) {\n                                error(\"%s: ignoring relative alternate object store %s\",\n                                                relative_base, last);\n                        } else {\n                                link_alt_odb_entry(last, cp - last,\n                                                relative_base, depth);\n                        }\n\nThe last is (if I understood the code correctly) begining of line, cp is end\nof that line and depth is depth of recursion in resolving the alternates. Now\nunless I read the code completely wrong, it means, that when git reads\na repository, it resolves relative paths in it's objects/info/alternates, but\nif that contains further alternates, it would ignore relative alternate paths\nthere -- and therefore not find objects needed from there.\n\nAnd my question is, is there any good reason to reject relative paths in\nalternates of an alternate? From what I see the recursive call to\nlink_alt_odb_entries (via link_alt_odb_entry and read_info_alternates) has\nall the information it needs to resolve such paths.\n\nThanks,\n\nJan\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"50441","messageId":"7vfy2rrxh1.fsf@assigned-by-dhcp.cox.net","threadId":"9475","inReplyTo":"20070810164556.GB3442@efreet.light.src","subject":"Re: Relative alternates question","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-10T19:38:50Z","receivedAt":"2007-08-10T19:38:50Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jan Hudec <bulb@ucw.cz> writes:\n\n> And my question is, is there any good reason to reject relative paths in\n> alternates of an alternate? From what I see the recursive call to\n> link_alt_odb_entries (via link_alt_odb_entry and read_info_alternates) has\n> all the information it needs to resolve such paths.\n\nAs long as you are careful not to introduce loops that cause the\nrest of the code to add the same thing twice, I do not think\nthere is anything fundamentally wrong with relative alternate\npaths.  The original motivation of that check was not much more\nthan \"let's not complicate our lives by supporting it\", I think.\n"}]}