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

Re: [PATCH] Create a symbolic link as a regular file on filesystems without symlinks.

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 27, 2007, 22:44 UTC
Message-ID
<Pine.LNX.4.63.0702272342160.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<11726125052184-git-send-email-johannes.sixt@telecom.at>
Hi,
On Tue, 27 Feb 2007, Johannes Sixt wrote:
Show 10 quoted lines
> diff --git a/builtin-apply.c b/builtin-apply.c
> index bec95d6..1636807 100644
> --- a/builtin-apply.c
> +++ b/builtin-apply.c
> @@ -2284,7 +2284,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
>  {
>  	int fd;
>  
> -	if (S_ISLNK(mode))
> +	if (trust_symlink_fmt && S_ISLNK(mode))
First of all why "_fmt"? I would have called it "trust_symlinks".
Show 13 quoted lines
> diff --git a/entry.c b/entry.c
> index c2641dd..3d5c0e4 100644
> --- a/entry.c
> +++ b/entry.c
> @@ -100,6 +100,11 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
>  		if (to_tempfile) {
>  			strcpy(path, ".merge_link_XXXXXX");
>  			fd = mkstemp(path);
> +		} else if (!trust_symlink_fmt) {
> +			/* write a regular file */
> +			fd = create_file(path, 0666);
> +		}
> +		if (to_tempfile || !trust_symlink_fmt) {
Wouldn't this be better:
-  		if (to_tempfile) {
-  			strcpy(path, ".merge_link_XXXXXX");
-  			fd = mkstemp(path);
+  		if (to_tempfile || !trusk_symlink_fmt) {
+			if (to_tempfile) {
+	  			strcpy(path, ".merge_link_XXXXXX");
+				fd = mkstemp(path);
+			} else
+				fd = create_file(path, 0666);
Hmm?
Previous: Johannes SixtNext: Johannes Sixt
Message 7 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.