[GRASS-dev] [GRASS GIS] #2752: t.remove: add dual-step removal as in g.remove

#2752: t.remove: add dual-step removal as in g.remove
-------------------------+-------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.2
Component: Temporal | Version: svn-trunk
Keywords: t.remove | CPU: All
Platform: All |
-------------------------+-------------------------
At time t.remove removes data without warning and force flag.

There are two disadvantages:
  * the user being familiar with g.remove's behaviour will be surprised
  * there is no chance to catch the lack of using -rf (of course a user
error), leading to the situation:

{{{
GRASS 7.1.svn (eu_laea):~ > t.remove
lst_aggreg_modis_week@modis_lst_reconstructed_europe_daily
Note: registered maps themselves have not been removed, only the strds
}}}

... user's thought in this moment: "Heck, now the strds is gone but I
forgot to specify -rf to also get rid of the related raster maps and no
easy way to do that now... nor how to figure out their map names!"

I refer to situations where thousands of maps are stored in a mapset with
similar names which is common in time series processing.

'''Solution''':

At time it is a bit confusing since -f would be the best flag name (as it
is used in g.remove). I don't think that it would be a problem to even
redefine the meaning of -f in G7 since t.remove is still rather new.
Hence:

  * change meaning of -f to "force removal" (without -f only show what
would be done, yet don't remove). Advertise also -rf in the message.
  * -d Remove all registered maps from the temporal and also from the
spatial database (required for actual deletion of files)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by lucadelu):

Hi, please test this diff to see if it is following the requested
behaviour.

Other changes are requested in the testsuite of several t.* modules

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------
Changes (by lucadelu):

* Attachment "tremove.diff" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by neteler):

The question is how to deal with the flag character to be used...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.4
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by lucadelu):

Replying to [comment:5 neteler]:
> The question is how to deal with the flag character to be used...

Maybe I could apply this changes in trunk and not backport after we could
release these in the next stable major release

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.0.5
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by martinl):

Ping.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:8&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.0
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by neteler):

Why not have it in 7.2?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:11&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by martinl):

What is status of this issue?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:13&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by veroandreo):

Replying to [comment:13 martinl]:
> What is status of this issue?

The behavior described in the ticket is still the current behavior:
* no flag set: removes the strds directly (no warning) -->> I think it
would make sense to have a WARNING as in G7:g.remove and a flag to force
the removal of strds only

* if only -r flag is set, the user gets: `ERROR: The recursive flag works
only in conjunction with the force flag: use -rf` -->> IMHO, it would be
consistent with G7:g.remove to get the list of maps that will be removed
plus a WARNING with advice to use both flags (-rf) to actually remove
strds and maps, otherwise what is the point of having a flag (-r) that
cannot be used alone?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:14&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by lucadelu):

Replying to [comment:14 veroandreo]:
> Replying to [comment:13 martinl]:
> > What is status of this issue?
>
> The behavior described in the ticket is still the current behavior:
> * no flag set: removes the strds directly (no warning) -->> I think it
would make sense to have a WARNING as in G7:g.remove and a flag to force
the removal of strds only
>
> * if only -r flag is set, the user gets: `ERROR: The recursive flag
works only in conjunction with the force flag: use -rf` -->> IMHO, it
would be consistent with G7:g.remove to get the list of maps that will be
removed plus a WARNING with advice to use both flags (-rf) to actually
remove strds and maps, otherwise what is the point of having a flag (-r)
that cannot be used alone?
>

I think this is a behavior change and it could affect some add-ons since
-f should be used like in g.remove so to really remove. I think this
should released in next major release. I would like to have this behavior:
* without flag it show the warning
* -r to show the maps connected with the temporal dataset
* -f remove temporal dataset (with -r remove maps from temporal framework)
* -d to delete maps from mapset

What do you think?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:15&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.1
Component: Temporal | Version: svn-trunk
Resolution: | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------

Comment (by veroandreo):

Replying to [comment:15 lucadelu]:
> I think this is a behavior change and it could affect some add-ons since
-f should be used like in g.remove so to really remove. I think this
should released in next major release. I would like to have this behavior:
> * without flag it show the warning
> * -r to show the maps connected with the temporal dataset
> * -f remove temporal dataset (with -r remove maps from temporal
framework)
> * -d to delete maps from mapset
>
> What do you think?

Sorry for my ignorance here, but is a new flag needed?

I was thinking of:
* no flag: shows the warning that to remove strds -f should be used
* only -f: removes the strds, and warns that -rf should be used to remove
the maps
* only -r: shows maps in the strds that will be removed and warns that -r
and -f should be used to remove the maps
* -rf to remove strds and maps (as now)

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:16&gt;
GRASS GIS <https://grass.osgeo.org>

#2752: t.remove: add dual-step removal as in g.remove
--------------------------+-------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.4.1
Component: Temporal | Version: svn-trunk
Resolution: wontfix | Keywords: t.remove
       CPU: All | Platform: All
--------------------------+-------------------------
Changes (by veroandreo):

* status: new => closed
* resolution: => wontfix

Comment:

Since this would imply a change in the behaviour of the flags that is only
possible in major releases, we close this ticket as won't fix.
See #3362 for such a request for GRASS 8 :slight_smile:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2752#comment:17&gt;
GRASS GIS <https://grass.osgeo.org>