* Renaming a category?
@ 2001-04-23 6:26 Hans-Albert Schneider
2001-04-23 6:36 ` Yngve Svendsen
2001-04-27 5:13 ` Hans-Albert Schneider
0 siblings, 2 replies; 7+ messages in thread
From: Hans-Albert Schneider @ 2001-04-23 6:26 UTC (permalink / raw)
To: gnats-devel
What is the preferred way to rename a category?
For GNATS 3.113, I am currently aware of the following procedure
(assume renaming from "A" to "B"):
1) Create a new category "B".
2) Edit each report in "A", changing the category to "B".
3) Remove category "A".
4) Run gen-index.
(I once tried to just rename the directory from "A" to "B" (and
the entry in gnats-adm/categories, of course), and found that
gen-index produced A/17 instead of B/17, because the Category
field had not been changed. This was probably with an earlier
version than 3.113; is gen-index now more clever about this?)
Is there an easier way? Maybe with version 4?
In step 2), do I need to invoke edit-pr and manually edit all
reports, or can I just run something like
for each report $n in category A,
sed -e "/^>Category:/ s/A/B/" < A/$n > B/$n
rm A/$n
Thanks for your hints,
Hans-Albert
--
Hans-Albert Schneider <Hans-Albert.Schneider@mchp.siemens.de>
Siemens AG phone: (+49) 89 636 45445
Corporate Technology fax: (+49) 89 636 42284
Munich, Germany
-- To get my public PGP key, send me a mail with subject "send key" --
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Renaming a category?
2001-04-23 6:26 Renaming a category? Hans-Albert Schneider
@ 2001-04-23 6:36 ` Yngve Svendsen
2001-04-27 5:13 ` Hans-Albert Schneider
1 sibling, 0 replies; 7+ messages in thread
From: Yngve Svendsen @ 2001-04-23 6:36 UTC (permalink / raw)
To: Hans-Albert.Schneider, gnats-devel
At 15:26 23.04.2001 +0200, Hans-Albert Schneider wrote:
>What is the preferred way to rename a category?
>
>For GNATS 3.113, I am currently aware of the following procedure
>(assume renaming from "A" to "B"):
>
>1) Create a new category "B".
>2) Edit each report in "A", changing the category to "B".
>3) Remove category "A".
>4) Run gen-index.
>
>(I once tried to just rename the directory from "A" to "B" (and
>the entry in gnats-adm/categories, of course), and found that
>gen-index produced A/17 instead of B/17, because the Category
>field had not been changed. This was probably with an earlier
>version than 3.113; is gen-index now more clever about this?)
>
>
>Is there an easier way? Maybe with version 4?
>
>In step 2), do I need to invoke edit-pr and manually edit all
>reports, or can I just run something like
>
> for each report $n in category A,
> sed -e "/^>Category:/ s/A/B/" < A/$n > B/$n
> rm A/$n
I don't think there is a better way. I have had to do the same thing myself
on a few occasions. Automating step 2 should be OK, though. Gnats4 has no
improvements with regards to this. This might be an idea for a new admin
tool in a future version.
Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway
yngve.svendsen@clustra.com
Cell.: +47 913 915 02
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Renaming a category?
2001-04-23 6:26 Renaming a category? Hans-Albert Schneider
2001-04-23 6:36 ` Yngve Svendsen
@ 2001-04-27 5:13 ` Hans-Albert Schneider
1 sibling, 0 replies; 7+ messages in thread
From: Hans-Albert Schneider @ 2001-04-27 5:13 UTC (permalink / raw)
To: gnats-devel
It's time for a summary:
>>>>> "HAS" == Hans-Albert Schneider <Hans-Albert.Schneider@mchp.siemens.de> writes:
HAS> What is the preferred way to rename a category? For
HAS> GNATS 3.113, I am currently aware of the following
HAS> procedure (assume renaming from "A" to "B"):
HAS> 1) Create a new category "B".
HAS> 2) Edit each report in "A", changing the category to "B".
HAS> 3) Remove category "A".
HAS> 4) Run gen-index.
[...]
HAS> Is there an easier way? Maybe with version 4?
Summary:
There is currently no other way, neither in version 3.x
nor in version 4.
HAS> In step 2), do I need to invoke edit-pr and manually
HAS> edit all reports, or can I just run something like
[simple minded for-loop with sed removed]
Summary:
To take care of locking, edit-pr or pr-edit --lock should
be used. Otherwise, automating is OK.
I already had the idea to use edit-pr with the EDITOR variable
set to something like the sed command. I meanwhile have written
a shell script to do this. (This also was an exercise for me to
write a script that tries to be a bit security conscious, so its
purpose was not just to re-invent the wheel.)
Tools:
There is a PERL script by Sherry Wasserman.
There is also my script now. :-)
Thanks for replying to:
Yngve Svendsen
Sherry Wasserman
Rick Macdonald
Hans-Albert
--
Hans-Albert Schneider <Hans-Albert.Schneider@mchp.siemens.de>
Siemens AG phone: (+49) 89 636 45445
Corporate Technology fax: (+49) 89 636 42284
Munich, Germany
-- To get my public PGP key, send me a mail with subject "send key" --
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Renaming a category?
2001-04-23 8:39 Wasserman, Sherry
2001-04-23 11:26 ` Rick Macdonald
@ 2001-05-20 13:33 ` Milan Zamazal
1 sibling, 0 replies; 7+ messages in thread
From: Milan Zamazal @ 2001-05-20 13:33 UTC (permalink / raw)
To: Wasserman, Sherry; +Cc: gnats-devel
>>>>> "WS" == Wasserman, Sherry <Sherry.Wasserman@comverse.com> writes:
WS> I recently created a tool to move all PRs from one category to another
WS> with the following command:
WS> perl catmove [-d gnats_root] <old category> <new category> ...
WS> I'll be happy to send this, if you are interested.
Of course we are interested, could you send me it, please?
Thanks,
Milan Zamazal
--
Omigod, it's a flame war about a flame war. You know, a meta-flame war!
Kenny Tilton in comp.lang.lisp
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Renaming a category?
2001-04-23 11:26 ` Rick Macdonald
@ 2001-04-23 12:11 ` Yngve Svendsen
0 siblings, 0 replies; 7+ messages in thread
From: Yngve Svendsen @ 2001-04-23 12:11 UTC (permalink / raw)
To: Rick Macdonald, Wasserman, Sherry; +Cc: Hans-Albert.Schneider, gnats-devel
At 12:26 23.04.2001 -0600, Rick Macdonald wrote:
>On Mon, 23 Apr 2001, Wasserman, Sherry wrote:
>
> > I recently created a tool to move all PRs from one category to another
> > with the following command:
> > perl catmove [-d gnats_root] <old category> <new category> ...
> >
> > I'll be happy to send this, if you are interested.
>
>This should be added to the contrib directory (if there still is one) or
>become part of gnats itself!
I agree. Presumably, it's specifically created for Gnats 3, but no major
changes should be necessary for v4.
I assume Milan will grab hold of this when he has time.
Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway
yngve.svendsen@clustra.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Renaming a category?
2001-04-23 8:39 Wasserman, Sherry
@ 2001-04-23 11:26 ` Rick Macdonald
2001-04-23 12:11 ` Yngve Svendsen
2001-05-20 13:33 ` Milan Zamazal
1 sibling, 1 reply; 7+ messages in thread
From: Rick Macdonald @ 2001-04-23 11:26 UTC (permalink / raw)
To: Wasserman, Sherry
Cc: 'Yngve Svendsen', Hans-Albert.Schneider, gnats-devel
On Mon, 23 Apr 2001, Wasserman, Sherry wrote:
> I recently created a tool to move all PRs from one category to another
> with the following command:
> perl catmove [-d gnats_root] <old category> <new category> ...
>
> I'll be happy to send this, if you are interested.
This should be added to the contrib directory (if there still is one) or
become part of gnats itself!
...RickM...
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: Renaming a category?
@ 2001-04-23 8:39 Wasserman, Sherry
2001-04-23 11:26 ` Rick Macdonald
2001-05-20 13:33 ` Milan Zamazal
0 siblings, 2 replies; 7+ messages in thread
From: Wasserman, Sherry @ 2001-04-23 8:39 UTC (permalink / raw)
To: 'Yngve Svendsen', Hans-Albert.Schneider, gnats-devel
Hello,
If others have access to the gnats database while you are changing the
category, you should probably be concerned about locking the PRs.
If you change the category field manually (by using gnatsweb or edit-pr),
the normal PR locking mechanism will prevent changes (yours or theirs) from
being overwritten. The PR will also be moved to the new category location
and the index entry will be created by the software. You won't have to do
gen-index.
If you use sed, you should either lock the PRs that are going
to be changed (pr-edit --lock), or lock gnats by creating the gnats.lock
file
in the gnats-admin directory. (Don't forget to remove the locks it when
you're done.)
I recently created a tool to move all PRs from one category to another
with the following command:
perl catmove [-d gnats_root] <old category> <new category> ...
I'll be happy to send this, if you are interested.
Sherry Wasserman
Comverse
1025 Briggs Rd., Suite 100
Mt. Laurel, NJ 08054
Voice (856) 608-2858 Fax (856) 866-8850
> -----Original Message-----
> From: Yngve Svendsen [ mailto:yngve.svendsen@clustra.com ]
> Sent: Monday, April 23, 2001 9:35 AM
> To: Hans-Albert.Schneider@mchp.siemens.de;
> gnats-devel@sources.redhat.com
> Subject: Re: Renaming a category?
>
>
> At 15:26 23.04.2001 +0200, Hans-Albert Schneider wrote:
> >What is the preferred way to rename a category?
> >
> >For GNATS 3.113, I am currently aware of the following procedure
> >(assume renaming from "A" to "B"):
> >
> >1) Create a new category "B".
> >2) Edit each report in "A", changing the category to "B".
> >3) Remove category "A".
> >4) Run gen-index.
> >
> >(I once tried to just rename the directory from "A" to "B" (and
> >the entry in gnats-adm/categories, of course), and found that
> >gen-index produced A/17 instead of B/17, because the Category
> >field had not been changed. This was probably with an earlier
> >version than 3.113; is gen-index now more clever about this?)
> >
> >
> >Is there an easier way? Maybe with version 4?
> >
> >In step 2), do I need to invoke edit-pr and manually edit all
> >reports, or can I just run something like
> >
> > for each report $n in category A,
> > sed -e "/^>Category:/ s/A/B/" < A/$n > B/$n
> > rm A/$n
>
> I don't think there is a better way. I have had to do the
> same thing myself
> on a few occasions. Automating step 2 should be OK, though.
> Gnats4 has no
> improvements with regards to this. This might be an idea for
> a new admin
> tool in a future version.
>
>
>
> Yngve Svendsen
> IS Engineer
> Clustra AS, Trondheim, Norway
> yngve.svendsen@clustra.com
> Cell.: +47 913 915 02
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2001-05-20 13:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23 6:26 Renaming a category? Hans-Albert Schneider
2001-04-23 6:36 ` Yngve Svendsen
2001-04-27 5:13 ` Hans-Albert Schneider
2001-04-23 8:39 Wasserman, Sherry
2001-04-23 11:26 ` Rick Macdonald
2001-04-23 12:11 ` Yngve Svendsen
2001-05-20 13:33 ` Milan Zamazal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).