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

Re: optimize gitdiff-do script

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 18, 2005, 18:30 UTC
Message-ID
<20050418183038.GB5554@pasky.ji.cz>
In-Reply-To
<20050418082334.25359013.pj@sgi.com>

Dear diary, on Mon, Apr 18, 2005 at 05:23:34PM CEST, I got a letter where Paul Jackson <pj@sgi.com> told me that...

> Pasky,
> 
> Looks like a couple of questions I asked over the weekend
> got lost along the way.

Yes, sorry about that; I had a lot of mail traffic lately and I'm not so used to it. ;-)

>  1) How do you want me to fix the indentation on my patch
>     to optimize gitdiff-do script:
> 	- forget my first patch and resend from scratch, or
> 	- a second patch restoring indentation, on top of my first one.
Resend from scratch, please.

I cannot guarantee I will look at it immediately, though. Optimizing is nice, but gitdiff-do's speed is already usable and there are much more pressing issues for git-pasky right now.

Show 23 quoted lines
>  2) Would you be interested in a patch that used a more robust tmp
>     file creation, along the lines of replacing
> 
> 	    t=${TMPDIR:-/usr/tmp}/gitdiff.$$
> 	    trap 'set +f; rm -fr $t.?; trap 0; exit 0' 0 1 2 3 15
> 
>     with:
> 
> 	    tmp=${TMPDIR-/tmp}
> 	    tmp=$tmp/gitdiff-do.$RANDOM.$RANDOM.$RANDOM.$$
> 	    (umask 077 && mkdir $tmp) || {
> 		    echo "Could not create temporary directory! Exiting." 1>&2 
> 		    exit 1
> 	    }
> 	    trap 'rm -fr $tmp; trap 0; exit 0' 0 1 2 3 15
> 	    t=$tmp/tmp
> 
>     From the www.linuxsecurity.com link that Dave Jones provided, the
>     above $tmp directory is about as good as using mktemp, while
>     avoiding both dependency on mktemp options not everyone has.
> 
>  3) If interested in (2), would you want it instead of my previous mktemp
>     removal patch, or on top of it?

Instead of the previous patch. But what I said still holds - this can go in only after we have a shell library sharing the common functions - I don't want to have this horrid stuff in every file.

Actually, if you will make a mktemp shell function, no changes whatsoever might be needed to the other scripts.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Paul JacksonNext: Paul Jackson
Message 7 of 25 in “fix mktemp (remove mktemp ;)”
  1. fix mktemp (remove mktemp ;)Paul Jackson, Apr 16, 2005
  2. missing mkdir -p flag in gitdiff-doPaul Jackson, Apr 16, 2005
  3. optimize gitdiff-do scriptPaul Jackson, Apr 16, 2005
  4. Petr BaudisApr 16, 2005
  5. Paul JacksonApr 17, 2005
  6. Paul JacksonApr 18, 2005
  7. Petr BaudisApr 18, 2005
  8. Paul JacksonApr 18, 2005
  9. Paul JacksonMay 10, 2005
  10. Jan-Benedict GlawApr 16, 2005
  11. Paul JacksonApr 16, 2005
  12. Petr BaudisApr 16, 2005
  13. Paul JacksonApr 17, 2005
  14. Dave JonesApr 17, 2005
  15. Paul JacksonApr 17, 2005
  16. Dave JonesApr 17, 2005
  17. David LangApr 17, 2005
  18. Paul JacksonApr 17, 2005
  19. Brian O'MahoneyApr 17, 2005
  20. Paul JacksonApr 17, 2005
  21. Erik van KonijnenburgApr 17, 2005
  22. Paul JacksonApr 17, 2005
  23. Herbert XuApr 18, 2005
  24. Paul JacksonApr 18, 2005
  25. Florian WeimerApr 18, 2005

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.