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

Re: [PATCH 2/2] update cg-* to use cg-Xignore

From
David Greaves <david@dgreaves.com>
Date
May 14, 2005, 08:24 UTC
Message-ID
<4285B5CA.8060106@dgreaves.com>
In-Reply-To
<20050513225516.GG32232@pasky.ji.cz>
Petr Baudis wrote:
Show 17 quoted lines
>Dear diary, on Sat, May 14, 2005 at 12:32:22AM CEST, I got a letter
>where David Greaves <david@dgreaves.com> told me that...
>  
>
>>Updated
>>    cg-add
>>    cg-commit
>>    
>>
>
>I consider this Bad Thing (tm). Or could you please point a situation
>where this would be actually useful? If you explicitly cg-add, you
>likely know what are you doing, and same thing with cg-commit - if it's
>already added, it should be watches, no matter what ignore patterns, I
>think.
>  
>

OK, lets say I'm clever and know what an ignore pattern is. I can find * | xargs cg-add my laziness something my hubris acknowledges :)

And in fact this has come up a few times on the list already - it was that code snippet in cg-init that caused me to create cg-Xignore because as someone pointed out, even finding files/links would still cause probs with files beginning with '.' does that sway you?

Show 24 quoted lines
>>--- d2490ad0bc8b38647c6baff9da3e72c0f25e9f35/cg-commit  (mode:100755)
>>+++ 03662df7d089d4a84987ef9edb50a017b8b42439/cg-commit  (mode:100755)
>>@@ -65,6 +65,15 @@
>> 	[ -s $_git/merging ] && merging=$(cat $_git/merging | sed 's/^/-p /')
>> fi
>> 
>>+# strip ignored files - *1 at a time* - any attempt to stream from 1
>>+# while loop to another uses a subprocess and can't pass the variable
>>+# back
>>+# Also I don't know if this can be put in a shell function
>>+for file in ${commitfiles[@]}
>>+  do
>>+  commitfiles[$i]=`echo $file | cg-Xignore`
>>+  ((i++))
>>+done
>> 
>> LOGMSG=$(mktemp -t gitci.XXXXXX)
>> LOGMSG2=$(mktemp -t gitci.XXXXXX)
>>    
>>
>
>The variable? What variable?
>  
>

well basically we want to edit the commitfiles variable - perl map() a more efficient method in shell appears to be: foreach file in commitfiles; echo file | filter | read into commitfiles I spent ages trying not to exec a cg-Ignore process per file comparison

Show 26 quoted lines
>>Index: cg-status
>>===================================================================
>>--- d2490ad0bc8b38647c6baff9da3e72c0f25e9f35/cg-status  (mode:100755)
>>+++ 03662df7d089d4a84987ef9edb50a017b8b42439/cg-status  (mode:100755)
>>@@ -15,21 +15,11 @@
>> 
>> {
>> 	git-ls-files -z -t --others --deleted --unmerged $EXCLUDE
>>-} | sort -z -k 2 | xargs -0 sh -c '
>>-while [ "$1" ]; do
>>-	tag=${1% *};
>>-	filename=${1#* };
>>-	case "$filename" in
>>-	*.[ao] | tags | ,,merge*) ;;
>>-	*)   echo "$tag $filename";;
>>-	esac
>>-	shift
>>-done
>>-' padding
>>+} | sort -z -k 2 | cg-Xignore -0 -t | tr "\000" "\n"
>>    
>>
>
>So you have two ignores now - exclude and Xignore.
>  
>

No, cogito has an ignore. git has a less powerful exclude. cogito users won't need exclude but power-users aren't barred from it.

David
Previous: Petr BaudisNext: Petr Baudis
Message 3 of 6 in “update cg-* to use cg-Xignore”
  1. 2/2 update cg-* to use cg-XignoreDavid Greaves, May 13, 2005
  2. Petr BaudisMay 13, 2005
  3. David GreavesMay 14, 2005
  4. Petr BaudisMay 14, 2005
  5. David GreavesMay 14, 2005
  6. Petr BaudisMay 14, 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.