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

Re: [PATCH] Do not change the file type if the filesystem does not support symlinks.

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Feb 28, 2007, 17:40 UTC
Message-ID
<200702281840.07893.johannes.sixt@telecom.at>
In-Reply-To
<Pine.LNX.4.63.0702272352080.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Tuesday 27 February 2007 23:54, Johannes Schindelin wrote:
Show 16 quoted lines
> On Tue, 27 Feb 2007, Johannes Sixt wrote:
> > diff --git a/read-cache.c b/read-cache.c
> > index 605b352..f09ee2e 100644
> > --- a/read-cache.c
> > +++ b/read-cache.c
> > @@ -116,7 +116,8 @@ static int ce_match_stat_basic(struct cache_entry
> > *ce, struct stat *st)
> >
> >  	switch (ntohl(ce->ce_mode) & S_IFMT) {
> >  	case S_IFREG:
> > -		changed |= !S_ISREG(st->st_mode) ? TYPE_CHANGED : 0;
> > +		if (trust_symlink_fmt && !S_ISREG(st->st_mode))
> > +			changed |= TYPE_CHANGED;
>
> Really? If the cache entry says S_IFREG we should not expect a symlink
> here, right?

Don't know what I was smoking here. This hunk just doesn't need to be there at all...

Show 10 quoted lines
>
> > @@ -125,7 +126,8 @@ static int ce_match_stat_basic(struct cache_entry
> > *ce, struct stat *st) changed |= MODE_CHANGED;
> >  		break;
> >  	case S_IFLNK:
> > -		changed |= !S_ISLNK(st->st_mode) ? TYPE_CHANGED : 0;
> > +		if (trust_symlink_fmt && !S_ISLNK(st->st_mode))
> > +			changed |= TYPE_CHANGED;
>
> This does not handle the case symlink->directory, right?
Something like:
		if (!S_ISLNK(st->st_mode) &&
		    (trust_symlink_fmt || !S_ISREG(st->st_mode)))
			changed |= TYPE_CHANGE;

BTW, considering the size of the entire patch series, I'm thinking of submitting it in a single patch.

-- Hannes
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 18 in “Implement core.symlinks to support filesystems without symlinks”
  1. Johannes SixtFeb 27, 2007
  2. Add a flag core.symlinks analogous to core.filemode.Johannes Sixt, Feb 27, 2007
  3. Do not change the file type if the filesystem does not support symlinks.Johannes Sixt, Feb 27, 2007
  4. Create a symbolic link as a regular file on filesystems without symlinks.Johannes Sixt, Feb 27, 2007
  5. diff-lib.c: Ignore type differences if the filesystem does not support symlinks.Johannes Sixt, Feb 27, 2007
  6. Describe core.symlinks in the man pages.Johannes Sixt, Feb 27, 2007
  7. Johannes SchindelinFeb 27, 2007
  8. Johannes SixtFeb 28, 2007
  9. Johannes SchindelinFeb 27, 2007
  10. Johannes SixtFeb 28, 2007
  11. Johannes SchindelinFeb 28, 2007
  12. Robin RosenbergFeb 27, 2007
  13. Johannes SchindelinFeb 28, 2007
  14. Robin RosenbergFeb 28, 2007
  15. Johannes SchindelinMar 1, 2007
  16. Robin RosenbergMar 1, 2007
  17. Johannes SchindelinMar 1, 2007
  18. Johannes SixtMar 1, 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.