git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Frank Illenseer <illenseer@altair.de>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Git Alias not working in worktree
Date: Fri, 25 Sep 2020 22:28:01 +0000	[thread overview]
Message-ID: <20200925222801.GC1392312@camp.crustytoothpaste.net> (raw)
In-Reply-To: <DM5PR03MB2826C04CC5AAF3B61BDDAFE2B5360@DM5PR03MB2826.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2291 bytes --]

On 2020-09-25 at 16:44:25, Frank Illenseer wrote:
> Dear Git User-group,
> 
> I am having a setup where I use worktrees and I was now experimenting with adding git aliases to work more efficiently with the commands.
> However I found that obviously it does not seem to work like I would like to have it:
> 
> My intention is to have a ".gitconfig" file as part of the repo so that all developers can easily get to the same configuration that was setup and also to have the config tracked as part of the repo.
> We are using Git for Windows v2.28 and also git 2.28 on Linux.

I'm not sure about what's causing the issue that you're having, but let
me dissuade you from trying to store configuration in the repository.
Git's security model doesn't permit untrusted configuration because
configuration can be used to specify programs and execute arbitrary
code.  If you specify a config file that's in the repository and someone
checks out a branch with a malicious config file, they can execute
arbitrary code on that system.

If you want to provide settings, it would be better to provide a shell
script that developers could _optionally_ run (after first verifying)
that sets certain config options.  Because that would be run only on
demand by the user and can be inspected before running, it would be a
lot more secure.  In addition, if you're setting aliases, it's possible
that the user may already have an alias for that option that they are
used to and expect to work a certain way (e.g., my "git co" is
recursive) and may not want your alias.

I realize you may be working in a corporate environment where users are
somewhat more trusted, but take note that you probably don't let
developers execute arbitrary code on each other's systems and social
engineering attacks ("Hey, can you check out this branch and see why the
code isn't working?") are easy.  There's a big difference between "I
ran this script" and "I checked out this branch".

Hopefully someone else can provide an answer to why your alias isn't
working.  I have some guesses, but no definitive answers at the moment.
I'll try to play around with some things and figure it out over the next
couple of days if nobody gets to it before me.
-- 
brian m. carlson: Houston, Texas, US

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2020-09-25 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DM5PR03MB2826A616AC30710E169B7237B5360@DM5PR03MB2826.namprd03.prod.outlook.com>
2020-09-25 16:44 ` Git Alias not working in worktree Frank Illenseer
2020-09-25 22:28   ` brian m. carlson [this message]
2020-10-07 15:51     ` Frank Illenseer
2020-10-22 12:06       ` Frank Illenseer
2020-10-22 19:06         ` Eric Sunshine
2020-10-22 19:25           ` Randall S. Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200925222801.GC1392312@camp.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=illenseer@altair.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).