On Mon, Nov 29, 2021 at 11:17 AM Peter Humphrey <[email protected]> wrote:
>
> On Monday, 29 November 2021 16:03:25 GMT Rich Freeman wrote:
> > On Mon, Nov 29, 2021 at 5:39 AM tastytea <[email protected]> wrote:
> > > If you want the history for a file, you need to specify the full path:
> > >
> > > git log sys-devel/gcc/gcc-11.2.1_p20211127.ebuild
> >
> > You can also point it at a directory and get changes for the entire
> > directory.  I also suggest trying "git whatchanged" as an alternative
> > to "git log."
>
> I didn't know about whatchanged. I tried it like this and got 120k lines of
> output:
>
> # (cd /var/db/repos/gentoo/sys-devel/gcc && git whatchanged)

You'd get just as much output from git log - you didn't restrict the
output so it ran on the entire repository.  The current working
directory has no impact on the function of either git log or git
whatchanged.

You could append a . to just run git whatchanged on the current
directory.  I run "git whatchanged ." all the time.

> I've always found git counter-intuitive and I've resisted trying to understand
> it, so far. Maybe I should make a little more effort.

IMO time spent understanding git is highly rewarded.  It isn't going anywhere.

I've heard it said that git is a data model masquerading as an SCM,
and that is very accurate.  If you don't understand how it works
you're going to be fighting it.

I get that you shouldn't have to know how the data model works to use
a piece of software, but git runs pretty close to the metal.  Sure,
you can always just copy/paste some one-liner that you read on a
website, but you're always going to feel like you're wrestling it.
Linus basically built it for himself and a handful of people like him,
and it shows.  It is very powerful, but it is a bit like trying to use
binutils without wanting to know what an ELF is.

-- 
Rich

Reply via email to