* Recent changes for the unsafe directory handling - TINY improvement requested in error output
@ 2022-04-19 11:26 Nathan Neulinger
2022-04-20 6:16 ` Bagas Sanjaya
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Neulinger @ 2022-04-19 11:26 UTC (permalink / raw)
To: git
While I understand the need for the recent changes (even if I'd prefer they be limited to turning off any
filter/script/custom alias/etc. support) - there is one piece of the new behavior that could be improved for usability:
If you do a 'git status' in the directory - you get the "helpful" response:
root@server:/local/APPNAME/bin# git status
fatal: unsafe repository ('/local/APPNAME' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /local/APPNAME
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:
root@SERVER:/local/APPNAME/bin# git diff
warning: Not a git repository. Use --no-index to compare two paths outside a working tree
usage: git diff --no-index [<options>] <path> <path>
...snip-long-diff-help...
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.
In case it matters for why I'm hitting this - server with various different application accounts. All maintained by a
trusted list of users, but separated into different users for permissions isolation between the apps/repos/etc. Often
edit/commit/etc. as other root or as other users (when facl's are being used). Running 1:2.25.1-1ubuntu3.3 on ubuntu
20.04 in case this is already addressed in upstream and just not included in ubuntu repackaging.
-- Nathan
------------------------------------------------------------
Nathan Neulinger nneul@neulinger.org
Neulinger Consulting (573) 612-1412
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Recent changes for the unsafe directory handling - TINY improvement requested in error output
2022-04-19 11:26 Recent changes for the unsafe directory handling - TINY improvement requested in error output Nathan Neulinger
@ 2022-04-20 6:16 ` Bagas Sanjaya
2022-04-20 13:29 ` Nathan Neulinger
0 siblings, 1 reply; 3+ messages in thread
From: Bagas Sanjaya @ 2022-04-20 6:16 UTC (permalink / raw)
To: Nathan Neulinger, git
On 4/19/22 18:26, Nathan Neulinger wrote:
> 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:
>
> root@SERVER:/local/APPNAME/bin# git diff
> warning: Not a git repository. Use --no-index to compare two paths outside a working tree
> usage: git diff --no-index [<options>] <path> <path>
> ...snip-long-diff-help...
>
> 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.
>
I assumed that you have /local/APPNAME/bin shared by users (maybe via
NFS or something else), right?
I agreed with your suggestion. Also, I think usage help for git diff
in this case just add noise.
--
An old man doll... just what I always wanted! - Clara
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Recent changes for the unsafe directory handling - TINY improvement requested in error output
2022-04-20 6:16 ` Bagas Sanjaya
@ 2022-04-20 13:29 ` Nathan Neulinger
0 siblings, 0 replies; 3+ messages in thread
From: Nathan Neulinger @ 2022-04-20 13:29 UTC (permalink / raw)
To: Bagas Sanjaya, git
On 4/20/22 01:16, Bagas Sanjaya wrote:
> On 4/19/22 18:26, Nathan Neulinger wrote:
>> 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:
>>
>> root@SERVER:/local/APPNAME/bin# git diff
>> warning: Not a git repository. Use --no-index to compare two paths outside a working tree
>> usage: git diff --no-index [<options>] <path> <path>
>> ...snip-long-diff-help...
>>
>> 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.
>>
>
> I assumed that you have /local/APPNAME/bin shared by users (maybe via
> NFS or something else), right?
Actually, each /local/APPUSER is the base of the clone - dev environment on master/main, test env on 'test' and prod env
on 'production'.
Depending on the deployment we're either logging in directly as the application, or as common or admin accounts that
have access over multiple application directory trees. The applications themselves each have their own userid for
permissions isolation.
-- Nathan
------------------------------------------------------------
Nathan Neulinger nneul@neulinger.org
Neulinger Consulting (573) 612-1412
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-20 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 11:26 Recent changes for the unsafe directory handling - TINY improvement requested in error output Nathan Neulinger
2022-04-20 6:16 ` Bagas Sanjaya
2022-04-20 13:29 ` Nathan Neulinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).