git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add core.symlinks to mark filesystems that do not support symbolic links.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 2, 2007, 21:35 UTC
Message-ID
<Pine.LNX.4.63.0703022219360.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<200703022211.30322.johannes.sixt@telecom.at>
Hi,

BTW since git.git's RelNotes is a symlink this patch is needed for MinGW. I tried to commit something yesterday, and had to use cygwin to do it, since MinGW Git always complained about "invalid tree d5e055...". For those who don't know: try "git show d5e055" in your Git repository.

On Fri, 2 Mar 2007, Johannes Sixt wrote:
Show 10 quoted lines
> diff --git a/cache.h b/cache.h
> index 04f8e63..6f932fe 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -108,7 +108,10 @@ static inline unsigned int create_ce_mode(unsigned int mode)
>  }
>  static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode)
>  {
> -	extern int trust_executable_bit;
> +	extern int trust_executable_bit, has_symlinks;

Would it not be better to move the global variables before this function? I.e. these:

Show 46 quoted lines
> @@ -202,6 +205,7 @@ extern int delete_ref(const char *, unsigned char *sha1);
>  /* Environment bits from configuration mechanism */
>  extern int use_legacy_headers;
>  extern int trust_executable_bit;
> +extern int has_symlinks;
>  extern int assume_unchanged;
>  extern int prefer_symlink_refs;
>  extern int log_all_ref_updates;
>
> [...]
>
> diff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh
> new file mode 100644
> index 0000000..969ef89
> --- /dev/null
> +++ b/t/t2102-update-index-symlinks.sh
> @@ -0,0 +1,31 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2007 Johannes Sixt
> +#
> +
> +test_description='git-update-index on filesystem w/o symlinks test.
> +
> +This tests that git-update-index keeps the symbolic link property
> +even if a plain file is in the working tree if core.symlinks is false.'
> +
> +. ./test-lib.sh
> +
> +test_expect_success \
> +'preparation' '
> +git-config core.symlinks false &&
> +l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
> +echo "120000 $l	symlink" | git-update-index --index-info'
> +
> +test_expect_success \
> +'modify the symbolic link' '
> +echo -n new-file > symlink &&
> +git-update-index symlink'
> +
> +test_expect_success \
> +'the index entry must still be a symbolic link' '
> +case "`git-ls-files --stage --cached symlink`" in
> +120000" "*symlink) echo ok;;
> +*) echo fail; git-ls-files --stage --cached symlink; (exit 1);;
> +esac'

Please test also what happens if you replace a supposed symlink with a directory and vice versa.

Ciao, Dscho

Previous: Johannes SixtNext: Johannes Sixt
Message 2 of 8 in “Add core.symlinks to mark filesystems that do not support symbolic links.”
  1. Add core.symlinks to mark filesystems that do not support symbolic links.Johannes Sixt, Mar 2, 2007
  2. Johannes SchindelinMar 2, 2007
  3. Johannes SixtMar 2, 2007
  4. Junio C HamanoMar 3, 2007
  5. Junio C HamanoMar 3, 2007
  6. Johannes SixtMar 3, 2007
  7. Junio C HamanoMar 3, 2007
  8. Narrow checkouts, was Re: [PATCH] Add core.symlinks to mark filesystems that do not support symbolic links.Johannes Schindelin, Mar 3, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.