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

Re: [COGITO PATCH] Small, simple and obvious cleanups (are they wanted at this stage?)

From
Petr Baudis <pasky@ucw.cz>
Date
Jun 5, 2005, 20:25 UTC
Message-ID
<20050605202527.GO17462@pasky.ji.cz>
In-Reply-To
<429E0B08.5040603@gkhs.net>

Dear diary, on Wed, Jun 01, 2005 at 09:22:48PM CEST, I got a letter where "C. Cooke" <ccooke@gkhs.net> told me that...

Show 5 quoted lines
> This is a simple example - giving a nice error if you're in the wrong
> directory.
> 
> Is this sort of patch wanted? If so, I'm sure I can spare the time to
> look into some polishing.
Of course they are wanted. Thanks, applied.
Show 32 quoted lines
> ------------------------------
> Add some sanity checking - does $_git exist, and is it writable.
> 
> ---
> commit 06afdeefff9fe02cd2a67f223e687646cacf736f
> tree cebc55541b89b5370335fc172814feb48456dc85
> parent 20e473c9afd8b5d2d549b0e7881473600beb9c37
> author C. Cooke <ccooke@slab.earth.gkhs.net> Wed, 01 Jun 2005 20:03:46 +0100
> committer C. Cooke <ccooke@slab.earth.gkhs.net> Wed, 01 Jun 2005
> 20:03:46 +0100
> 
>  cg-Xnormid |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/cg-Xnormid b/cg-Xnormid
> --- a/cg-Xnormid
> +++ b/cg-Xnormid
> @@ -16,6 +16,15 @@
> 
>  id="$1"
> 
> +# A little sanity checking.
> +if [ ! -d "$_git" ]; then
> +       echo "There is no Git repository here ($_git not found)" >&2
> +       exit 1
> +elif [ ! -r "$_git" ] || [ ! -x "$_git" ]; then
> +       echo "You do not have permission to access this git repository" >&2
> +       exit 1
> +fi
> +
>  if [ ! "$id" ] || [ "$id" = "this" ] || [ "$id" = "HEAD" ]; then
>         read id < "$_git/HEAD"
I removed the -r check. What is it good for?
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: C. CookeNext: Petr Baudis
Message 2 of 3 in “Small, simple and obvious cleanups (are they wanted at this stage?)”
  1. Small, simple and obvious cleanups (are they wanted at this stage?)C. Cooke, Jun 1, 2005
  2. Petr BaudisJun 5, 2005
  3. Petr BaudisJun 5, 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.