Subject: bug#78415: closed (Re: bug#78415: documentation: -R v -r difference is not just about symlinks)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 14 May 2025 23:00:02 +0000

Your bug report

#78415: documentation: -R v -r difference is not just about symlinks

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78415: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78415
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78415: documentation: -R v -r difference is not just about symlinks
From: Jim Meyering <[email-masked]>
To: Matěj Cepl <[email-masked]>
Cc: [email-masked]
Date: Wed, 14 May 2025 15:59:18 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

tags 78415 + notabug
stop

On Tue, May 13, 2025 at 6:58 PM Matěj Cepl <[email-masked]> wrote:
> manpage grep(1) describes the difference between -r and -R options thus:
>
>     -r, --recursive
>         Read all files under each directory, recursively, following
>         symbolic links only if they are on the command line. Note
>         that if no file operand is given, grep searches the working
>         directory. This is equivalent to the -d recurse option.
>
>     -R, --dereference-recursive
>         Read all files under each directory, recursively. Follow all
>         symbolic links, unlike -r.
>
> It seems to me that outside of this advertised difference in
> following/non-following symlinks, -R option also makes grep to
> search through hidden directories. Is it so? Wouldn’t it be a
> good idea to put it into a manpage?

Please tell us why you think that.
At least for me, with either -r or -R, grep searches directories whose
names start with ".":

$ mkdir -p .j/.j && cd .j && echo a > .j/a
$ grep -r a
.j/a:a
$ grep -R a
.j/a:a

I'm marking this as done. If you show evidence of a problem, it's easy
to reopen.

Subject: documentation: -R v -r difference is not just about symlinks
From: Matěj Cepl <[email-masked]>
To: <[email-masked]>
Date: Tue, 13 May 2025 19:38:11 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

manpage grep(1) describes the difference between -r and -R options thus:

    -r, --recursive
        Read all files under each directory, recursively, following
        symbolic links only if they are on the command line. Note
        that if no file operand is given, grep searches the working
        directory. This is equivalent to the -d recurse option.

    -R, --dereference-recursive
        Read all files under each directory, recursively. Follow all
        symbolic links, unlike -r.

It seems to me that outside of this advertised difference in
following/non-following symlinks, -R option also makes grep to
search through hidden directories. Is it so? Wouldn’t it be a
good idea to put it into a manpage?

Best,

Matěj Cepl

-- 
http://matej.ceplovi.cz/blog/, @[email-masked]
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
“Goodbye,” said the fox. “And now here is my secret, a very
simple secret: It is only with the heart that one can see
rightly; what is essential is invisible to the eye.”
   -- Antoine de Saint-Exupery