* [PATCH v2 0/3] More ls improvements
@ 2024-06-08 21:58 Glenn Washburn
2024-06-08 21:58 ` [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments Glenn Washburn
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Glenn Washburn @ 2024-06-08 21:58 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Vladimir Serbinenko, Glenn Washburn
Currently when given a path to a file, ls will open the file to determine
if its is valid and then run the appropriate print function, in contrast to
directory arguments that use the directory iterator and callback on each
file. One issue with this is that opening a file does not allow access to
its modification time information, whereas the info object from the callback
called by the directory iterator does and the longlist print function will
print the modification time if present. The result is that when longlisting
ls arguments, directory arguments show moditication times but file arguments
do not. Patch 1 rectifies this an in the process simplifies the code path
by using the directory iterator for file arguments as well.
Patches 2 and 3 aim to make the output of GRUB's ls look more like GNU's
ls output. And patch 3 also fixes an issue where there are blank lines
between consecutive file arguments.
v2:
* Remove first patch of v1
* Reset grub_errno in grub_ls_list_files instead
Glenn Washburn (3):
commands/ls: Allow printing mtime for file arguments
commands/ls: Add directory header for dir args and print full paths
for file args
commands/ls: Proper line breaks between arguments
grub-core/commands/ls.c | 123 ++++++++++++++++++++++++----------------
1 file changed, 75 insertions(+), 48 deletions(-)
Range-diff against v1:
1: c9066a31480c < -: ------------ disk: Reset grub_errno upon entering grub_disk_read()
2: 8947f5257962 ! 1: 187a173d6e8a commands/ls: Allow printing mtime for file arguments
@@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
&& path[grub_strlen (path) - 1] != '/')
{
- /* PATH might be a regular file. */
+- /* PATH might be a regular file. */
- char *p;
- grub_file_t file;
- struct grub_dirhook_info info;
@@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
- goto fail;
-
- grub_file_close (file);
--
++ /*
++ * Reset errno as it is currently set, but will cause subsequent code
++ * to think there is an error.
++ */
++ grub_errno = GRUB_ERR_NONE;
+
- p = grub_strrchr (dirname, '/') + 1;
- ctx.dirname = grub_strndup (dirname, p - dirname);
++ /* PATH might be a regular file. */
+ ctx.filename = grub_strrchr (dirname, '/') + 1;
+ ctx.dirname = grub_strndup (dirname, ctx.filename - dirname);
if (ctx.dirname == NULL)
3: ce655165f508 ! 2: cd02a1fa4512 commands/ls: Add directory header for dir args and print full paths for file args
@@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
(fs->fs_dir) (dev, path, print_files, &ctx);
@@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int all, int human)
- && path[grub_strlen (path) - 1] != '/')
- {
+ grub_errno = GRUB_ERR_NONE;
+
/* PATH might be a regular file. */
+ ctx.print_dirhdr = 0;
ctx.filename = grub_strrchr (dirname, '/') + 1;
4: 1a14220825c2 = 3: 6988321447be commands/ls: Proper line breaks between arguments
--
2.34.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments
2024-06-08 21:58 [PATCH v2 0/3] More ls improvements Glenn Washburn
@ 2024-06-08 21:58 ` Glenn Washburn
2024-11-27 16:23 ` Daniel Kiper
2024-06-08 21:58 ` [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args Glenn Washburn
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Glenn Washburn @ 2024-06-08 21:58 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Vladimir Serbinenko, Glenn Washburn
File arguments were processed differently than files listed from directory
arguments. A side effect of this was that mtime was not shown for file
arguments when long listing was enabled. Refactor to have the same code
path for printing files that are arguments and ones that are contained in
directories. This also has the added benefit of simplifying the code path.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/commands/ls.c | 76 ++++++++++++++++++++---------------------
1 file changed, 37 insertions(+), 39 deletions(-)
diff --git a/grub-core/commands/ls.c b/grub-core/commands/ls.c
index 6a1c7f5d3626..6a45b998e30d 100644
--- a/grub-core/commands/ls.c
+++ b/grub-core/commands/ls.c
@@ -87,8 +87,10 @@ grub_ls_list_devices (int longlist)
struct grub_ls_list_files_ctx
{
char *dirname;
+ char *filename;
int all;
int human;
+ int longlist;
};
/* Helper for grub_ls_list_files. */
@@ -98,22 +100,17 @@ print_files (const char *filename, const struct grub_dirhook_info *info,
{
struct grub_ls_list_files_ctx *ctx = data;
- if (ctx->all || filename[0] != '.')
- grub_printf ("%s%s ", filename, info->dir ? "/" : "");
-
- return 0;
-}
-
-/* Helper for grub_ls_list_files. */
-static int
-print_files_long (const char *filename, const struct grub_dirhook_info *info,
- void *data)
-{
- struct grub_ls_list_files_ctx *ctx = data;
-
if ((! ctx->all) && (filename[0] == '.'))
return 0;
+ if (! ctx->longlist)
+ {
+ if (ctx->filename != NULL)
+ grub_xputs (ctx->dirname);
+ grub_printf ("%s%s ", filename, info->dir ? "/" : "");
+ return 0;
+ }
+
if (! info->dir)
{
grub_file_t file;
@@ -170,6 +167,19 @@ print_files_long (const char *filename, const struct grub_dirhook_info *info,
return 0;
}
+/* Helper for grub_ls_list_files. */
+static int
+print_file (const char *filename, const struct grub_dirhook_info *info,
+ void *data)
+{
+ struct grub_ls_list_files_ctx *ctx = data;
+
+ if (grub_strcmp (filename, ctx->filename) != 0)
+ return 0;
+
+ return print_files (filename, info, data);
+}
+
static grub_err_t
grub_ls_list_files (char *dirname, int longlist, int all, int human)
{
@@ -216,42 +226,30 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
{
struct grub_ls_list_files_ctx ctx = {
.dirname = dirname,
+ .filename = NULL,
.all = all,
- .human = human
+ .human = human,
+ .longlist = longlist
};
- if (longlist)
- (fs->fs_dir) (dev, path, print_files_long, &ctx);
- else
- (fs->fs_dir) (dev, path, print_files, &ctx);
+ (fs->fs_dir) (dev, path, print_files, &ctx);
if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
&& path[grub_strlen (path) - 1] != '/')
{
- /* PATH might be a regular file. */
- char *p;
- grub_file_t file;
- struct grub_dirhook_info info;
- grub_errno = 0;
-
- file = grub_file_open (dirname, GRUB_FILE_TYPE_GET_SIZE
- | GRUB_FILE_TYPE_NO_DECOMPRESS);
- if (! file)
- goto fail;
-
- grub_file_close (file);
+ /*
+ * Reset errno as it is currently set, but will cause subsequent code
+ * to think there is an error.
+ */
+ grub_errno = GRUB_ERR_NONE;
- p = grub_strrchr (dirname, '/') + 1;
- ctx.dirname = grub_strndup (dirname, p - dirname);
+ /* PATH might be a regular file. */
+ ctx.filename = grub_strrchr (dirname, '/') + 1;
+ ctx.dirname = grub_strndup (dirname, ctx.filename - dirname);
if (ctx.dirname == NULL)
goto fail;
- all = 1;
- grub_memset (&info, 0, sizeof (info));
- if (longlist)
- print_files_long (p, &info, &ctx);
- else
- print_files (p, &info, &ctx);
+ (fs->fs_dir) (dev, ctx.dirname, print_file, &ctx);
grub_free (ctx.dirname);
}
@@ -268,7 +266,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
grub_free (device_name);
- return 0;
+ return GRUB_ERR_NONE;
}
static grub_err_t
--
2.34.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args
2024-06-08 21:58 [PATCH v2 0/3] More ls improvements Glenn Washburn
2024-06-08 21:58 ` [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments Glenn Washburn
@ 2024-06-08 21:58 ` Glenn Washburn
2024-11-27 16:27 ` Daniel Kiper
2024-06-08 21:58 ` [PATCH v2 3/3] commands/ls: Proper line breaks between arguments Glenn Washburn
2024-11-08 19:20 ` [PATCH v2 0/3] More ls improvements Glenn Washburn
3 siblings, 1 reply; 9+ messages in thread
From: Glenn Washburn @ 2024-06-08 21:58 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Vladimir Serbinenko, Glenn Washburn
Like the GNU ls first print a line with the directory path before printing
files in the directory, which will not have a directory component, but only
if there is more than one argument. Also, for arguments that are paths to
files, print the full path of the file.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/commands/ls.c | 25 ++++++++++++++++++-------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/grub-core/commands/ls.c b/grub-core/commands/ls.c
index 6a45b998e30d..10939eefeab5 100644
--- a/grub-core/commands/ls.c
+++ b/grub-core/commands/ls.c
@@ -91,6 +91,7 @@ struct grub_ls_list_files_ctx
int all;
int human;
int longlist;
+ int print_dirhdr;
};
/* Helper for grub_ls_list_files. */
@@ -98,11 +99,18 @@ static int
print_files (const char *filename, const struct grub_dirhook_info *info,
void *data)
{
+ char *pathname = NULL;
struct grub_ls_list_files_ctx *ctx = data;
if ((! ctx->all) && (filename[0] == '.'))
return 0;
+ if (ctx->print_dirhdr)
+ {
+ grub_printf ("%s:\n", ctx->dirname);
+ ctx->print_dirhdr = 0;
+ }
+
if (! ctx->longlist)
{
if (ctx->filename != NULL)
@@ -114,7 +122,6 @@ print_files (const char *filename, const struct grub_dirhook_info *info,
if (! info->dir)
{
grub_file_t file;
- char *pathname;
if (ctx->dirname[grub_strlen (ctx->dirname) - 1] == '/')
pathname = grub_xasprintf ("%s%s", ctx->dirname, filename);
@@ -140,7 +147,6 @@ print_files (const char *filename, const struct grub_dirhook_info *info,
else
grub_xputs ("????????????");
- grub_free (pathname);
grub_errno = GRUB_ERR_NONE;
}
else
@@ -162,7 +168,10 @@ print_files (const char *filename, const struct grub_dirhook_info *info,
datetime.day, datetime.hour,
datetime.minute, datetime.second);
}
- grub_printf ("%s%s\n", filename, info->dir ? "/" : "");
+ grub_printf ("%s%s\n", (ctx->filename) ? pathname : filename,
+ info->dir ? "/" : "");
+
+ grub_free (pathname);
return 0;
}
@@ -181,7 +190,7 @@ print_file (const char *filename, const struct grub_dirhook_info *info,
}
static grub_err_t
-grub_ls_list_files (char *dirname, int longlist, int all, int human)
+grub_ls_list_files (char *dirname, int longlist, int all, int human, int dirhdr)
{
char *device_name;
grub_fs_t fs;
@@ -229,7 +238,8 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
.filename = NULL,
.all = all,
.human = human,
- .longlist = longlist
+ .longlist = longlist,
+ .print_dirhdr = dirhdr
};
(fs->fs_dir) (dev, path, print_files, &ctx);
@@ -244,6 +254,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
grub_errno = GRUB_ERR_NONE;
/* PATH might be a regular file. */
+ ctx.print_dirhdr = 0;
ctx.filename = grub_strrchr (dirname, '/') + 1;
ctx.dirname = grub_strndup (dirname, ctx.filename - dirname);
if (ctx.dirname == NULL)
@@ -279,8 +290,8 @@ grub_cmd_ls (grub_extcmd_context_t ctxt, int argc, char **args)
grub_ls_list_devices (state[0].set);
else
for (i = 0; i < argc; i++)
- grub_ls_list_files (args[i], state[0].set, state[2].set,
- state[1].set);
+ grub_ls_list_files (args[i], state[0].set, state[2].set, state[1].set,
+ argc > 1);
return 0;
}
--
2.34.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 3/3] commands/ls: Proper line breaks between arguments
2024-06-08 21:58 [PATCH v2 0/3] More ls improvements Glenn Washburn
2024-06-08 21:58 ` [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments Glenn Washburn
2024-06-08 21:58 ` [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args Glenn Washburn
@ 2024-06-08 21:58 ` Glenn Washburn
2024-11-27 16:29 ` Daniel Kiper
2024-11-08 19:20 ` [PATCH v2 0/3] More ls improvements Glenn Washburn
3 siblings, 1 reply; 9+ messages in thread
From: Glenn Washburn @ 2024-06-08 21:58 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Vladimir Serbinenko, Glenn Washburn
There should be a blank line before each directory argument and before
each file arugment that come after a directory argument. This brings the
ls command more inline with GNU's ls. Although one key difference still is
that GNU's ls reorders the output of arguments so that all file arguments
are grouped at the beginning of output, while GRUB's ls does no reordering
and shows output for each arument in the order that it was specified on
the command line. Also fixed is an issue where there was a blank line
between the output of consecutive file path arguments, which needlessly
wastes valuable screen space.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
grub-core/commands/ls.c | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/grub-core/commands/ls.c b/grub-core/commands/ls.c
index 10939eefeab5..0a3070372821 100644
--- a/grub-core/commands/ls.c
+++ b/grub-core/commands/ls.c
@@ -92,6 +92,8 @@ struct grub_ls_list_files_ctx
int human;
int longlist;
int print_dirhdr;
+ int first_arg;
+ int prev_file;
};
/* Helper for grub_ls_list_files. */
@@ -105,6 +107,19 @@ print_files (const char *filename, const struct grub_dirhook_info *info,
if ((! ctx->all) && (filename[0] == '.'))
return 0;
+ /* Never print a leading newline if this is the first arg */
+ if (! ctx->first_arg)
+ /*
+ * Print leading newline(s) if (this is a file argument and the previous
+ * was not) or this is the first file from a directory argument.
+ */
+ if (((ctx->filename != NULL) && (! ctx->prev_file)) || ctx->print_dirhdr)
+ {
+ grub_xputs ("\n");
+ if (! ctx->longlist)
+ grub_xputs ("\n");
+ }
+
if (ctx->print_dirhdr)
{
grub_printf ("%s:\n", ctx->dirname);
@@ -190,7 +205,8 @@ print_file (const char *filename, const struct grub_dirhook_info *info,
}
static grub_err_t
-grub_ls_list_files (char *dirname, int longlist, int all, int human, int dirhdr)
+grub_ls_list_files (char *dirname, int longlist, int all, int human,
+ int dirhdr, int first_arg, int *prev_file)
{
char *device_name;
grub_fs_t fs;
@@ -239,7 +255,9 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human, int dirhdr)
.all = all,
.human = human,
.longlist = longlist,
- .print_dirhdr = dirhdr
+ .print_dirhdr = dirhdr,
+ .first_arg = first_arg,
+ .prev_file = *prev_file
};
(fs->fs_dir) (dev, path, print_files, &ctx);
@@ -262,11 +280,11 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human, int dirhdr)
(fs->fs_dir) (dev, ctx.dirname, print_file, &ctx);
+ *prev_file = 1;
grub_free (ctx.dirname);
}
-
- if (grub_errno == GRUB_ERR_NONE)
- grub_xputs ("\n");
+ else
+ *prev_file = 0;
grub_refresh ();
}
@@ -284,14 +302,14 @@ static grub_err_t
grub_cmd_ls (grub_extcmd_context_t ctxt, int argc, char **args)
{
struct grub_arg_list *state = ctxt->state;
- int i;
+ int i, prev_file = 0;
if (argc == 0)
grub_ls_list_devices (state[0].set);
else
for (i = 0; i < argc; i++)
grub_ls_list_files (args[i], state[0].set, state[2].set, state[1].set,
- argc > 1);
+ argc > 1, i == 0, &prev_file);
return 0;
}
--
2.34.1
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/3] More ls improvements
2024-06-08 21:58 [PATCH v2 0/3] More ls improvements Glenn Washburn
` (2 preceding siblings ...)
2024-06-08 21:58 ` [PATCH v2 3/3] commands/ls: Proper line breaks between arguments Glenn Washburn
@ 2024-11-08 19:20 ` Glenn Washburn
2024-11-12 16:12 ` Daniel Kiper
3 siblings, 1 reply; 9+ messages in thread
From: Glenn Washburn @ 2024-11-08 19:20 UTC (permalink / raw)
To: grub-devel, Daniel Kiper; +Cc: Vladimir Serbinenko
Ping. Wondering if this is still in the queue to be looked at.
Glenn
On Sat, 8 Jun 2024 16:58:30 -0500
Glenn Washburn <development@efficientek.com> wrote:
> Currently when given a path to a file, ls will open the file to determine
> if its is valid and then run the appropriate print function, in contrast to
> directory arguments that use the directory iterator and callback on each
> file. One issue with this is that opening a file does not allow access to
> its modification time information, whereas the info object from the callback
> called by the directory iterator does and the longlist print function will
> print the modification time if present. The result is that when longlisting
> ls arguments, directory arguments show moditication times but file arguments
> do not. Patch 1 rectifies this an in the process simplifies the code path
> by using the directory iterator for file arguments as well.
>
> Patches 2 and 3 aim to make the output of GRUB's ls look more like GNU's
> ls output. And patch 3 also fixes an issue where there are blank lines
> between consecutive file arguments.
>
> v2:
> * Remove first patch of v1
> * Reset grub_errno in grub_ls_list_files instead
>
> Glenn Washburn (3):
> commands/ls: Allow printing mtime for file arguments
> commands/ls: Add directory header for dir args and print full paths
> for file args
> commands/ls: Proper line breaks between arguments
>
> grub-core/commands/ls.c | 123 ++++++++++++++++++++++++----------------
> 1 file changed, 75 insertions(+), 48 deletions(-)
>
> Range-diff against v1:
> 1: c9066a31480c < -: ------------ disk: Reset grub_errno upon entering grub_disk_read()
> 2: 8947f5257962 ! 1: 187a173d6e8a commands/ls: Allow printing mtime for file arguments
> @@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
> if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
> && path[grub_strlen (path) - 1] != '/')
> {
> - /* PATH might be a regular file. */
> +- /* PATH might be a regular file. */
> - char *p;
> - grub_file_t file;
> - struct grub_dirhook_info info;
> @@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
> - goto fail;
> -
> - grub_file_close (file);
> --
> ++ /*
> ++ * Reset errno as it is currently set, but will cause subsequent code
> ++ * to think there is an error.
> ++ */
> ++ grub_errno = GRUB_ERR_NONE;
> +
> - p = grub_strrchr (dirname, '/') + 1;
> - ctx.dirname = grub_strndup (dirname, p - dirname);
> ++ /* PATH might be a regular file. */
> + ctx.filename = grub_strrchr (dirname, '/') + 1;
> + ctx.dirname = grub_strndup (dirname, ctx.filename - dirname);
> if (ctx.dirname == NULL)
> 3: ce655165f508 ! 2: cd02a1fa4512 commands/ls: Add directory header for dir args and print full paths for file args
> @@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int al
>
> (fs->fs_dir) (dev, path, print_files, &ctx);
> @@ grub-core/commands/ls.c: grub_ls_list_files (char *dirname, int longlist, int all, int human)
> - && path[grub_strlen (path) - 1] != '/')
> - {
> + grub_errno = GRUB_ERR_NONE;
> +
> /* PATH might be a regular file. */
> + ctx.print_dirhdr = 0;
> ctx.filename = grub_strrchr (dirname, '/') + 1;
> 4: 1a14220825c2 = 3: 6988321447be commands/ls: Proper line breaks between arguments
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/3] More ls improvements
2024-11-08 19:20 ` [PATCH v2 0/3] More ls improvements Glenn Washburn
@ 2024-11-12 16:12 ` Daniel Kiper
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Kiper @ 2024-11-12 16:12 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel, Vladimir Serbinenko
On Fri, Nov 08, 2024 at 01:20:25PM -0600, Glenn Washburn wrote:
> Ping. Wondering if this is still in the queue to be looked at.
Yes, it is. Sadly we have to finish other reviews first. Sorry for delay...
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments
2024-06-08 21:58 ` [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments Glenn Washburn
@ 2024-11-27 16:23 ` Daniel Kiper
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Kiper @ 2024-11-27 16:23 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel, Vladimir Serbinenko
On Sat, Jun 08, 2024 at 04:58:31PM -0500, Glenn Washburn wrote:
> File arguments were processed differently than files listed from directory
> arguments. A side effect of this was that mtime was not shown for file
> arguments when long listing was enabled. Refactor to have the same code
> path for printing files that are arguments and ones that are contained in
> directories. This also has the added benefit of simplifying the code path.
I think you are doing at least three different things in this patch. First
you change how print_files_long() works. Than you replace print_files()
and print_files_long() with print_files(). And finally you change how the
ls works in general. So, I can see three patches here...
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args
2024-06-08 21:58 ` [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args Glenn Washburn
@ 2024-11-27 16:27 ` Daniel Kiper
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Kiper @ 2024-11-27 16:27 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel, Vladimir Serbinenko
On Sat, Jun 08, 2024 at 04:58:32PM -0500, Glenn Washburn wrote:
> Like the GNU ls first print a line with the directory path before printing
> files in the directory, which will not have a directory component, but only
> if there is more than one argument. Also, for arguments that are paths to
> files, print the full path of the file.
The commit message suggests two patches here...
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 3/3] commands/ls: Proper line breaks between arguments
2024-06-08 21:58 ` [PATCH v2 3/3] commands/ls: Proper line breaks between arguments Glenn Washburn
@ 2024-11-27 16:29 ` Daniel Kiper
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Kiper @ 2024-11-27 16:29 UTC (permalink / raw)
To: Glenn Washburn; +Cc: grub-devel, Vladimir Serbinenko
On Sat, Jun 08, 2024 at 04:58:33PM -0500, Glenn Washburn wrote:
> There should be a blank line before each directory argument and before
> each file arugment that come after a directory argument. This brings the
> ls command more inline with GNU's ls. Although one key difference still is
> that GNU's ls reorders the output of arguments so that all file arguments
> are grouped at the beginning of output, while GRUB's ls does no reordering
> and shows output for each arument in the order that it was specified on
> the command line. Also fixed is an issue where there was a blank line
> between the output of consecutive file path arguments, which needlessly
> wastes valuable screen space.
Again, two separate patches?
Daniel
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-11-27 16:29 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-08 21:58 [PATCH v2 0/3] More ls improvements Glenn Washburn
2024-06-08 21:58 ` [PATCH v2 1/3] commands/ls: Allow printing mtime for file arguments Glenn Washburn
2024-11-27 16:23 ` Daniel Kiper
2024-06-08 21:58 ` [PATCH v2 2/3] commands/ls: Add directory header for dir args and print full paths for file args Glenn Washburn
2024-11-27 16:27 ` Daniel Kiper
2024-06-08 21:58 ` [PATCH v2 3/3] commands/ls: Proper line breaks between arguments Glenn Washburn
2024-11-27 16:29 ` Daniel Kiper
2024-11-08 19:20 ` [PATCH v2 0/3] More ls improvements Glenn Washburn
2024-11-12 16:12 ` Daniel Kiper
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.