Discussion:
[ABRT PATCH] abrt-cli list: don't print @N thing. rhbz#906733
Denys Vlasenko
2013-08-30 10:49:20 UTC
Permalink
Once upon a time it was meant to allow addressing problems with @N
instead of full name. However, it is problematic - what the numbering
should be if e.g. --since DATE was used? Should we scan all directories
regardless because we want to show the same @N's as in full list?
Same problem with "--full List even reported problems" versus
!--full.

I think git had a right idea: "shortcut" ID should be based on
substring match, not a numbering.

Signed-off-by: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
src/cli/list.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/cli/list.c b/src/cli/list.c
index 840d621..4ca334f 100644
--- a/src/cli/list.c
+++ b/src/cli/list.c
@@ -82,7 +82,6 @@ static void print_crash_list(vector_of_problem_data_t *crash_list, int detailed,
continue;
}

- printf("@%i\n", i);
print_crash(crash, detailed, text_size);
if (i != crash_list->len - 1)
printf("\n");
--
1.8.1.4
Jiri Moskovcak
2013-08-30 11:32:14 UTC
Permalink
Post by Denys Vlasenko
instead of full name. However, it is problematic - what the numbering
should be if e.g. --since DATE was used? Should we scan all directories
- I think it's scanning all the directories anyway, because it needs to
read the "time" element.
Post by Denys Vlasenko
Same problem with "--full List even reported problems" versus
!--full.
I think git had a right idea: "shortcut" ID should be based on
substring match, not a numbering.
NACK, please try a bit harder, this is not a good fix, it's just hiding
the problem. how about having and id for problems based on some
autoincremented value stored in /var/tmp/abrt?
Post by Denys Vlasenko
---
src/cli/list.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/cli/list.c b/src/cli/list.c
index 840d621..4ca334f 100644
--- a/src/cli/list.c
+++ b/src/cli/list.c
@@ -82,7 +82,6 @@ static void print_crash_list(vector_of_problem_data_t *crash_list, int detailed,
continue;
}
print_crash(crash, detailed, text_size);
if (i != crash_list->len - 1)
printf("\n");
Denys Vlasenko
2013-09-04 13:33:22 UTC
Permalink
Post by Jiri Moskovcak
Post by Denys Vlasenko
I think git had a right idea: "shortcut" ID should be based on
substring match, not a numbering.
NACK, please try a bit harder
Please find an alternative patch in the mailing list:

[ABRT PATCH] abrt-cli list: use sha1 hash as short ids instead of @N
thing. rhbz#906733

Once upon a time it was meant to allow addressing problems with @N
instead of full name. However, it is problematic - what the numbering
should be if e.g. --since DATE was used? Should we scan all directories
regardless because we want to show the same @N's as in full list?
Same problem with "--full List even reported problems" versus
!--full.

Instead, use git's trick of "shortcut IDs" based on SHA hashes.
In our case, use sha1 hash of directory name.

abrt-cli info STR will attempt to use STR as sha1 hash
of directory name if STR isn't an existing directory name,
is >= 5 chars long, and is a hex string.

Example:
$ abrt-cli list
...
@d9ca58e5b3e509759c582a5c162bfe24b23150dd
Directory: /var/tmp/abrt/oops-2013-08-27-14:08:13-9866-0
time: Tue 27 Aug 2013 02:08:13 PM CEST
$ abrt-cli info d9ca5
Directory: /var/tmp/abrt/oops-2013-08-27-14:08:13-9866-0
time: Tue 27 Aug 2013 02:08:13 PM CEST

Signed-off-by: Denys Vlasenko <dvlasenk-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
Loading...