git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
To: Alexander Gladysh <agladysh@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Bug: git add with absolute path fails if repo root dir is a symlink
Date: Mon, 27 Dec 2010 08:13:12 +0000	[thread overview]
Message-ID: <20101227081312.GA12735@sajinet.com.pe> (raw)
In-Reply-To: <AANLkTimPxhqwMebfTw9oHucuvABmSBynpZgG1zp6uwVz@mail.gmail.com>

On Mon, Dec 27, 2010 at 10:23:12AM +0300, Alexander Gladysh wrote:
> 
> > I can't run git add with absolute path if the repository's root
> > directory is a symlink.
> 
> Note that this issue is also triggered if *any* of the directories in
> path above of my repo are symlinks.

When using absolute path names, git will compare the path given with the
git work tree and any name that is referred through a symlink in that
will trigger a mismatch.

> Is there a way to quickly workaround this somehow?

use relative paths (implemented below through an alias named "myadd") :

[alias]
        myadd = "!sh -c 'cd `dirname \"$1\"` && git add `basename \"$1\"`' -"

so in your workflow you would use "myadd" instead of "add" to convert your
absolute paths (with symlinks) into relative paths

Carlo

      reply	other threads:[~2010-12-27  8:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27  6:25 Bug: git add with absolute path fails if repo root dir is a symlink Alexander Gladysh
2010-12-27  7:23 ` Alexander Gladysh
2010-12-27  8:13   ` Carlo Marcelo Arenas Belon [this message]

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

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

  git send-email \
    --in-reply-to=20101227081312.GA12735@sajinet.com.pe \
    --to=carenas@sajinet.com.pe \
    --cc=agladysh@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
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).