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

Re: [PATCH] Expand the rename(2) workaround in mingw to cover case change in filename

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 9, 2009, 07:27 UTC
Message-ID
<alpine.DEB.1.00.0906090924170.26154@pacific.mpi-cbg.de>
In-Reply-To
<81b0412b0906082304x750eb8cif3356458829de3bc@mail.gmail.com>
Hi,
On Tue, 9 Jun 2009, Alex Riesen wrote:
Show 25 quoted lines
> 2009/6/9 Johannes Sixt <j.sixt@viscovery.net>:
> > Alex Riesen schrieb:
> >> 2009/6/8 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> >>> On Mon, 8 Jun 2009, Alex Riesen wrote:
> >>>> NOT TESTED. Can't. My Windows broke again. Not even compile-tested.
> >>> Yes, that is pretty easy to see as you first used pold/pnew and then
> >>> src/dst.
> >>
> >> Yep.
> >>
> >>> I minimally fixed up your patch (it now uses strbuf), and added a
> >>> test-case.
> >>>
> >>> This test-case is actually crucial: it shows that your patch is not
> >>> enough: the culprit is this code in builtin-mv.c:167--168:
> >>>
> >>>                else if (lstat(dst, &st) == 0) {
> >>>                        bad = "destination exists";
> >>
> >> Ah, thanks. Missed that completely.
> >
> > That's the reason why I think any work-around for this problem is not
> > worth it.
> 
> What is the lstat is for, anyway?
It is to avoid overwriting existing files.
Show 6 quoted lines
> > If you want to be cross-platfrom, make up your mind about file names 
> > in advance.
> 
> I suspect it is the other way around. Some platforms just hate the idea 
> of being ported to. Or its designers have poor imagination and never 
> though about the fact that other platforms exist.

Actually, think about it as a brilliant business plan: make developers be stuck with developing for your platform, then they lack the time to take care of other platforms.

The bigger question with the patch is if the lstat() call can tell us if this is the same file (really the same, not just a hardlink (= same contents)).

Ciao, Dscho

Previous: Alex Riesen
Message 7 of 7 in “Expand the rename(2) workaround in mingw to cover case change in filename”
  1. Expand the rename(2) workaround in mingw to cover case change in filenameAlex Riesen, Jun 8, 2009
  2. Johannes SchindelinJun 8, 2009
  3. Johannes SchindelinJun 8, 2009
  4. Alex RiesenJun 8, 2009
  5. Johannes SixtJun 9, 2009
  6. Alex RiesenJun 9, 2009
  7. Johannes SchindelinJun 9, 2009

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.