git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Anthony Sottile <asottile@umich.edu>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: Johannes Sixt <j6t@kdbg.org>, Git Mailing List <git@vger.kernel.org>
Subject: Re: `git add <<windows 8.3 path to file inside repo>>` results in "fatal: ... is outside repository"
Date: Mon, 11 Mar 2019 11:16:32 -0700	[thread overview]
Message-ID: <CA+dzEBm7fdrncnd_7tDu-q047qxt3CsHVQna3GRMagJetisQeA@mail.gmail.com> (raw)
In-Reply-To: <20190311175519.6lbppv5u44w2u4sj@tb-raspi4>

On Mon, Mar 11, 2019 at 10:55 AM Torsten Bögershausen <tboegi@web.de> wrote:
>
> On Mon, Mar 11, 2019 at 06:48:11PM +0100, Johannes Sixt wrote:
> > Am 10.03.19 um 23:41 schrieb Anthony Sottile:
> > > git init longname-repo
> > > cd longname-repo
> > > touch f
> > > git add ..\longna~1\f
> > >
> > ...
> > >
> > > C:\Users\Anthony\AppData\Local\Temp\t\pre-commit-hooks\longname-repo>git
> > > add ..\longna~1\f
> > > fatal: ..\longna~1\f: '..\longna~1\f' is outside repository
> >
> > This has nothing to do with long vs. short path names. It would report
> > the same error when you say
> >
> >   git add ..\longname-repo\f
> >
> > -- Hannes
>
> You can probably do another test:
>
>  mkdir longname-rexxx
>  git init longname-repo
>  cd longname-repo
>  touch f
>  git add ..\longna~1\f
>
> And now nobody knows for shure if "longna~1"
> is longname-rexxx or longname-repo
>
> It may happen that it is longname-rep at this point in time,
> at your machine.
> It may happen that it is a complete different directory on another machine,
> or even on your machine.
> For that reason, to avoid that someone tampers data outside a repo,
> "../" (or ..\ under windows) is not accepted by Git.

the same can be said for `git add /full/path/to/repo/file` as any of
those components could be symlinks.

However that is currently allowed

Note also I've updated my report, it isn't about relative paths any
more but about full paths with 8.3 paths

Note that 8.3 filanames do canonically disambiguate themselves, the
number after the tilde is used to refer to filenames alphabetically

This report is very similar to the change that happened to
disambiguate drive letters in
https://github.com/git/git/commit/d8727b3687c1d249e84be71a581cc1fb0581336a


> Oops, I misreported while trying to minimize my reproduction
>
> Here's an accurate bug report
>
> git properly handles this:
>
>     git add C:\full\path\to\longname-repo\file
>
> When the root of the repo root is `C:\full\path\to\longname-repo`
>
> But it does not handle the equivalent 8.3 path:
>
>     git add C:\full\path\to\longna~1\file

  reply	other threads:[~2019-03-11 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-10 22:41 `git add <<windows 8.3 path to file inside repo>>` results in "fatal: ... is outside repository" Anthony Sottile
2019-03-11 17:48 ` Johannes Sixt
2019-03-11 17:53   ` Anthony Sottile
2019-03-11 17:55   ` Torsten Bögershausen
2019-03-11 18:16     ` Anthony Sottile [this message]
2019-03-11 19:34       ` Jack Adrian Zappa
2019-03-11 20:13         ` Anthony Sottile
2019-03-12 22:49         ` Johannes Schindelin

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=CA+dzEBm7fdrncnd_7tDu-q047qxt3CsHVQna3GRMagJetisQeA@mail.gmail.com \
    --to=asottile@umich.edu \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=tboegi@web.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).