{"thread":{"id":"2991","subject":"[PATCH] Lower priority of Cogito's default exclude patterns","startedAt":"2006-01-07T22:19:31Z","lastAt":"2006-01-21T02:04:23Z","messageCount":4,"participants":["Karl Hasselström","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"14267","messageId":"20060107221931.10616.25897.stgit@backpacker.hemma.treskal.com","threadId":"2991","inReplyTo":null,"subject":"[PATCH] Lower priority of Cogito's default exclude patterns","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-01-07T22:19:31Z","receivedAt":"2006-01-07T22:19:31Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Put the default exclude patterns in a file referenced with\n--exclude-from, instead of on the command line with --exclude. (The\nexisting behavior was bad since --exclude has higher priority than\n--exclude-from and --exclude-per-directory, which made it impossible\nfor the user to override the default patterns.)\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Makefile           |   15 +++++++++++++--\n cg-Xlib            |    6 +++++-\n cg-default-exclude |    6 ++++++\n 3 files changed, 24 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 700491f..9ec9d07 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3,6 +3,7 @@ prefix=$(HOME)\n \n bindir=$(prefix)/bin\n libdir=$(prefix)/lib/cogito\n+sharedir=$(prefix)/share/cogito\n \n INSTALL?=install\n \n@@ -25,6 +26,8 @@ GEN_SCRIPT= cg-version\n \n VERSION= VERSION\n \n+SHARE_FILES= cg-default-exclude\n+\n \n \n ### Build rules\n@@ -62,6 +65,7 @@ test: all\n ### Installation rules\n \n sedlibdir=$(shell echo $(libdir) | sed 's/\\//\\\\\\//g')\n+sedsharedir=$(shell echo $(sharedir) | sed 's/\\//\\\\\\//g')\n \n .PHONY: install install-cogito install-doc\n install: install-cogito\n@@ -83,14 +87,20 @@ install-cogito: $(SCRIPT) $(LIB_SCRIPT) \n \t$(INSTALL) $(LIB_SCRIPT) $(DESTDIR)$(libdir)\n \tcd $(DESTDIR)$(bindir); \\\n \tfor file in $(SCRIPT) $(GEN_SCRIPT); do \\\n-\t\tsed -e 's/\\$${COGITO_LIB}/\"\\$${COGITO_LIB:-$(sedlibdir)\\/}\"/g' $$file > $$file.new; \\\n+\t\tsed -e 's/\\$${COGITO_LIB}/\"\\$${COGITO_LIB:-$(sedlibdir)\\/}\"/g' $$file \\\n+\t\t  | sed -e 's/\\$${COGITO_SHARE}/\"\\$${COGITO_SHARE:-$(sedsharedir)\\/}\"/g' \\\n+\t\t  > $$file.new; \\\n \t\tcat $$file.new > $$file; rm $$file.new; \\\n \tdone\n \tcd $(DESTDIR)$(libdir); \\\n \tfor file in $(LIB_SCRIPT); do \\\n-\t\tsed -e 's/\\$${COGITO_LIB}/\"\\$${COGITO_LIB:-$(sedlibdir)\\/}\"/g' $$file > $$file.new; \\\n+\t\tsed -e 's/\\$${COGITO_LIB}/\"\\$${COGITO_LIB:-$(sedlibdir)\\/}\"/g' $$file \\\n+\t\t  | sed -e 's/\\$${COGITO_SHARE}/\"\\$${COGITO_SHARE:-$(sedsharedir)\\/}\"/g' \\\n+\t\t  > $$file.new; \\\n \t\tcat $$file.new > $$file; rm $$file.new; \\\n \tdone\n+\t$(INSTALL) -m755 -d $(DESTDIR)$(sharedir)\n+\t$(INSTALL) -m644 $(SHARE_FILES) $(DESTDIR)$(sharedir)\n \n install-doc:\n \t$(MAKE) -C Documentation install\n@@ -98,6 +108,7 @@ install-doc:\n uninstall:\n \tcd $(DESTDIR)$(bindir) && rm -f $(SCRIPT) $(GEN_SCRIPT)\n \tcd $(DESTDIR)$(libdir) && rm -f $(LIB_SCRIPT)\n+\tcd $(DESTDIR)$(sharedir) && rm -f $(SHARE_FILES)\n \n \n \ndiff --git a/cg-Xlib b/cg-Xlib\nindex 46a8a73..b1d1561 100755\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -190,9 +190,13 @@ list_untracked_files()\n \texcludeflag=\"$1\"; shift\n \tEXCLUDE=()\n \tif [ \"$excludeflag\" != \"no\" -a \"$excludeflag\" != \"noexclude\" ]; then\n-\t\tfor excl in '*.[ao]' '.*' '!.gitignore' tags '*~' '#*' \"$@\"; do\n+\t\tfor excl in \"$@\"; do\n \t\t\tEXCLUDE[${#EXCLUDE[@]}]=\"--exclude=$excl\"\n \t\tdone\n+\t\tEXCLUDEFILE=\"${COGITO_SHARE}cg-default-exclude\"\n+\t\tif [ -f \"$EXCLUDEFILE\" ]; then\n+\t\t\tEXCLUDE[${#EXCLUDE[@]}]=\"--exclude-from=$EXCLUDEFILE\"\n+\t\tfi\n \t\tEXCLUDEFILE=\"$_git/info/exclude\"\n \t\tif [ -f \"$EXCLUDEFILE\" ]; then\n \t\t\tEXCLUDE[${#EXCLUDE[@]}]=\"--exclude-from=$EXCLUDEFILE\"\ndiff --git a/cg-default-exclude b/cg-default-exclude\nnew file mode 100644\nindex 0000000..f24dad6\n--- /dev/null\n+++ b/cg-default-exclude\n@@ -0,0 +1,6 @@\n+*.[ao]\n+.*\n+!.gitignore\n+tags\n+*~\n+#*\n"},{"id":"14887","messageId":"20060119124244.GJ27976@pasky.or.cz","threadId":"2991","inReplyTo":"20060119100712.GA12154@diana.vm.bytemark.co.uk","subject":"Re: [PATCH] Lower priority of Cogito's default exclude patterns","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2006-01-19T12:42:44Z","receivedAt":"2006-01-19T12:42:44Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Jan 19, 2006 at 11:07:12AM CET, I got a letter\nwhere Karl Hasselström <kha@treskal.com> said that...\n> On 2006-01-07 23:19:31 +0100, Karl Hasselström wrote:\n> \n> > Put the default exclude patterns in a file referenced with\n> > --exclude-from, instead of on the command line with --exclude. (The\n> > existing behavior was bad since --exclude has higher priority than\n> > --exclude-from and --exclude-per-directory, which made it impossible\n> > for the user to override the default patterns.)\n> >\n> > Signed-off-by: Karl Hasselström <kha@treskal.com>\n> >\n> > ---\n> >\n> >  Makefile           |   15 +++++++++++++--\n> >  cg-Xlib            |    6 +++++-\n> >  cg-default-exclude |    6 ++++++\n> >  3 files changed, 24 insertions(+), 3 deletions(-)\n> \n> Did you miss this patch, or just not like it?\n\nJust postponed for next sweep through my patch queue, due today or\ntomorrow. ;) I will rename cg-default-exclude to default-exclude,\nthough.\n\nOh, now I remember - one my major concern is that now Cogito will not\nwork if not make install'd, which is how I actually primarily use it on\nmy machine.\n\nSorry for the delay,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nOf the 3 great composers Mozart tells us what it's like to be human,\nBeethoven tells us what it's like to be Beethoven and Bach tells us\nwhat it's like to be the universe.  -- Douglas Adams\n"},{"id":"14894","messageId":"20060119140728.GA14998@diana.vm.bytemark.co.uk","threadId":"2991","inReplyTo":"20060119124244.GJ27976@pasky.or.cz","subject":"Re: [PATCH] Lower priority of Cogito's default exclude patterns","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-01-19T14:07:28Z","receivedAt":"2006-01-19T14:07:28Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-01-19 13:42:44 +0100, Petr Baudis wrote:\n\n> Dear diary, on Thu, Jan 19, 2006 at 11:07:12AM CET, I got a letter\n> where Karl Hasselström <kha@treskal.com> said that...\n>\n> > On 2006-01-07 23:19:31 +0100, Karl Hasselström wrote:\n> >\n> > > Put the default exclude patterns in a file referenced with\n> > > --exclude-from, instead of on the command line with --exclude.\n> > > (The existing behavior was bad since --exclude has higher\n> > > priority than --exclude-from and --exclude-per-directory, which\n> > > made it impossible for the user to override the default\n> > > patterns.)\n> > >\n> > > Signed-off-by: Karl Hasselström <kha@treskal.com>\n> > >\n> > > ---\n> > >\n> > >  Makefile           |   15 +++++++++++++--\n> > >  cg-Xlib            |    6 +++++-\n> > >  cg-default-exclude |    6 ++++++\n> > >  3 files changed, 24 insertions(+), 3 deletions(-)\n> >\n> > Did you miss this patch, or just not like it?\n>\n> Just postponed for next sweep through my patch queue, due today or\n> tomorrow. ;) I will rename cg-default-exclude to default-exclude,\n> though.\n\nGood point.\n\n> Oh, now I remember - one my major concern is that now Cogito will\n> not work if not make install'd, which is how I actually primarily\n> use it on my machine.\n\nThe not-installed case could easily be worked around by users if\ncogito looked at /etc/cogito/exclude and ~/.cogito/exclude as well.\n(Or maybe that should be /etc/git/exclude and ~/.gitexclude, so that\ne.g. stgit can use the same files.) Would you accept a patch that did\nthis?\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"14970","messageId":"20060121020423.GJ28365@pasky.or.cz","threadId":"2991","inReplyTo":"20060119140728.GA14998@diana.vm.bytemark.co.uk","subject":"Re: [PATCH] Lower priority of Cogito's default exclude patterns","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-01-21T02:04:23Z","receivedAt":"2006-01-21T02:04:23Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Thanks, patch applied and pushed out.\n\nDear diary, on Thu, Jan 19, 2006 at 03:07:28PM CET, I got a letter\nwhere Karl Hasselström <kha@treskal.com> said that...\n> On 2006-01-19 13:42:44 +0100, Petr Baudis wrote:\n> > Oh, now I remember - one my major concern is that now Cogito will\n> > not work if not make install'd, which is how I actually primarily\n> > use it on my machine.\n> \n> The not-installed case could easily be worked around by users if\n> cogito looked at /etc/cogito/exclude and ~/.cogito/exclude as well.\n> (Or maybe that should be /etc/git/exclude and ~/.gitexclude, so that\n> e.g. stgit can use the same files.) Would you accept a patch that did\n> this?\n\nSorry, this doesn't make sense to me - how would that help? The user can\nas well just make install in that case, instead of manually copying out\none file.\n\n\tif [ -n \"${COGITO_SHARE}\" ]; then\n\t\tCOGITO_REAL_SHARE=\"${COGITO_SHARE}\"\n\t\treturn\n\tfi\n\tif [ \"${0%/*}\" != \"$0\" ]; then\n\t\tCOGITO_REAL_SHARE=\"${0%/*}/\"\n\t\treturn\n\tfi\n\t# I'm not sure if the following normally ever gets triggered.\n\t# I can only do it by `sh cg-status`. --pasky\n\tCOGITO_REAL_SHARE=\"./$_git_relpath/\"\n\nshould work well, though.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nOf the 3 great composers Mozart tells us what it's like to be human,\nBeethoven tells us what it's like to be Beethoven and Bach tells us\nwhat it's like to be the universe.  -- Douglas Adams\n"}]}