{"thread":{"id":"57761","subject":"Recent changes for the unsafe directory handling - TINY improvement requested in error output","startedAt":"2022-04-19T11:27:03Z","lastAt":"2022-04-20T13:29:52Z","messageCount":3,"participants":["Nathan Neulinger","Bagas Sanjaya"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"453923","messageId":"ec588ff7-b300-bc3a-b51c-67d190b27e9b@neulinger.org","threadId":"57761","inReplyTo":null,"subject":"Recent changes for the unsafe directory handling - TINY improvement requested in error output","fromName":"Nathan Neulinger","fromEmail":"nneul@neulinger.org","sentAt":"2022-04-19T11:26:52Z","receivedAt":"2022-04-19T11:27:03Z","isPatch":false,"sender":{"key":"nneul@neulinger.org","avatar":"https://gravatar.com/avatar/6bf7d938addba77b29fe46572be573fd52d1e4dbea47218c4397d760c87aabd1?d=mp&s=160"},"body":"\nWhile I understand the need for the recent changes (even if I'd prefer they be limited to turning off any \nfilter/script/custom alias/etc. support) - there is one piece of the new behavior that could be improved for usability:\n\nIf you do a 'git status' in the directory - you get the \"helpful\" response:\n\n   root@server:/local/APPNAME/bin# git status\n   fatal: unsafe repository ('/local/APPNAME' is owned by someone else)\n   To add an exception for this directory, call:\n\n   git config --global --add safe.directory /local/APPNAME\n\nHowever, if you do a 'git diff' - such as what you might naturally do right before attempting a 'git commit' - you do \nNOT get any useful response:\n\n   root@SERVER:/local/APPNAME/bin# git diff\n   warning: Not a git repository. Use --no-index to compare two paths outside a working tree\n   usage: git diff --no-index [<options>] <path> <path>\n   ...snip-long-diff-help...\n\nPlease consider a small improvement to have the git diff help output (if displayed due to the repo exclusion warning) - \nALSO display the 'git config' suggestion at the end of the output, instead of me having to remember - oh, go issue \nstatus to get the command hint to go set the exclusion. Would also be useful to have the git diff output do the same \n'unsafe repository' message about ownership.\n\n\n\nIn case it matters for why I'm hitting this - server with various different application accounts. All maintained by a \ntrusted list of users, but separated into different users for permissions isolation between the apps/repos/etc. Often \nedit/commit/etc. as other root or as other users (when facl's are being used). Running 1:2.25.1-1ubuntu3.3 on ubuntu \n20.04 in case this is already addressed in upstream and just not included in ubuntu repackaging.\n\n\n-- Nathan\n\n------------------------------------------------------------\nNathan Neulinger                       nneul@neulinger.org\nNeulinger Consulting                   (573) 612-1412\n"},{"id":"453953","messageId":"e689bb30-dc7f-6e3d-a8d5-864e00de59d4@gmail.com","threadId":"57761","inReplyTo":"ec588ff7-b300-bc3a-b51c-67d190b27e9b@neulinger.org","subject":"Re: Recent changes for the unsafe directory handling - TINY improvement requested in error output","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2022-04-20T06:16:57Z","receivedAt":"2022-04-20T06:17:12Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 4/19/22 18:26, Nathan Neulinger wrote:\n> However, if you do a 'git diff' - such as what you might naturally do right before attempting a 'git commit' - you do NOT get any useful response:\n> \n>   root@SERVER:/local/APPNAME/bin# git diff\n>   warning: Not a git repository. Use --no-index to compare two paths outside a working tree\n>   usage: git diff --no-index [<options>] <path> <path>\n>   ...snip-long-diff-help...\n> \n> Please consider a small improvement to have the git diff help output (if displayed due to the repo exclusion warning) - ALSO display the 'git config' suggestion at the end of the output, instead of me having to remember - oh, go issue status to get the command hint to go set the exclusion. Would also be useful to have the git diff output do the same 'unsafe repository' message about ownership.\n> \n\nI assumed that you have /local/APPNAME/bin shared by users (maybe via\nNFS or something else), right?\n\nI agreed with your suggestion. Also, I think usage help for git diff\nin this case just add noise.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"453980","messageId":"abf42057-7b40-0995-45a8-ac927800c485@neulinger.org","threadId":"57761","inReplyTo":"e689bb30-dc7f-6e3d-a8d5-864e00de59d4@gmail.com","subject":"Re: Recent changes for the unsafe directory handling - TINY improvement requested in error output","fromName":"Nathan Neulinger","fromEmail":"nneul@neulinger.org","sentAt":"2022-04-20T13:29:43Z","receivedAt":"2022-04-20T13:29:52Z","isPatch":false,"sender":{"key":"nneul@neulinger.org","avatar":"https://gravatar.com/avatar/6bf7d938addba77b29fe46572be573fd52d1e4dbea47218c4397d760c87aabd1?d=mp&s=160"},"body":"\n\nOn 4/20/22 01:16, Bagas Sanjaya wrote:\n> On 4/19/22 18:26, Nathan Neulinger wrote:\n>> However, if you do a 'git diff' - such as what you might naturally do right before attempting a 'git commit' - you do NOT get any useful response:\n>>\n>>    root@SERVER:/local/APPNAME/bin# git diff\n>>    warning: Not a git repository. Use --no-index to compare two paths outside a working tree\n>>    usage: git diff --no-index [<options>] <path> <path>\n>>    ...snip-long-diff-help...\n>>\n>> Please consider a small improvement to have the git diff help output (if displayed due to the repo exclusion warning) - ALSO display the 'git config' suggestion at the end of the output, instead of me having to remember - oh, go issue status to get the command hint to go set the exclusion. Would also be useful to have the git diff output do the same 'unsafe repository' message about ownership.\n>>\n> \n> I assumed that you have /local/APPNAME/bin shared by users (maybe via\n> NFS or something else), right?\n\nActually, each /local/APPUSER is the base of the clone - dev environment on master/main, test env on 'test' and prod env \non 'production'.\n\nDepending on the deployment we're either logging in directly as the application, or as common or admin accounts that \nhave access over multiple application directory trees. The applications themselves each have their own userid for \npermissions isolation.\n\n-- Nathan\n------------------------------------------------------------\nNathan Neulinger                       nneul@neulinger.org\nNeulinger Consulting                   (573) 612-1412\n"}]}