From: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
To: Samuel Lijin <sxlijin@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [suggestion] Include commit-ish in git status output
Date: Thu, 15 Jun 2017 19:10:13 -0500 [thread overview]
Message-ID: <CACcTrKdatvtqoMDiR5DR6cP_0gsqZnQDGbpq6vj6MU-+ABWF_w@mail.gmail.com> (raw)
In-Reply-To: <CAJZjrdW=1MbT=Lmouswez3W4hGP=anuMqMnQPkLta_fhUU4hCg@mail.gmail.com>
On Thu, Jun 15, 2017 at 6:55 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>
> Can you elaborate on why you consider this useful specifically?
Personally, primary usages of the current commit-ish info are to file bug
reports that include the specific git revision of any given branch that a bug
was observed in/on and to quickly note the currently checked-out revision prior
to pulling the latest changes from an upstream server so that I can rollback
without needing to tag/branch if needed.
But that's not really the reason why I emailed in with this suggestion. I think
semantically the "status" of a working folder is perhaps best summed up as the
sha1 of the commit (or its commit-ish, for short) plus the currently
staged/unstaged changes to the checked out copy of that revision to indicate
the _current_ status (there's that word again!) of the current git directory,
combined with branch information to indicate where any staged changes would be
committed to.
Currently, git shows two-thirds of the information needed to actually describe
the actual working state (status) of a git directory (being the branch and
staged/unchanged changes to HEAD), but does not describe what HEAD is in a
stateless manner.
>
> Do you think adding a $(git rev-parse HEAD) to your PS1 would do the trick?
This is a bit more subjective, but my personal preference is to keep a minimal
shell that retains its behavior regardless of whether I'm cd'd into a git repo
or if I'm transcoding my music collection.
I have no problem needing to execute something to view the commit-ish when it
is desired; this suggestion is merely focusing on what the something should be.
I have no problem using `git rev-parse` for other tasks, but feel that needing
a combination of `git status` and `git rev-parse HEAD` to accurately get a
summary of the current state of a repo is perhaps much.
Thanks.
next prev parent reply other threads:[~2017-06-16 0:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 23:43 [suggestion] Include commit-ish in git status output Mahmoud Al-Qudsi
2017-06-15 23:55 ` Samuel Lijin
2017-06-16 0:10 ` Mahmoud Al-Qudsi [this message]
2017-06-16 21:41 ` Junio C Hamano
2017-08-07 21:41 ` Mahmoud Al-Qudsi
2017-08-07 22:53 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACcTrKdatvtqoMDiR5DR6cP_0gsqZnQDGbpq6vj6MU-+ABWF_w@mail.gmail.com \
--to=mqudsi@neosmart.net \
--cc=git@vger.kernel.org \
--cc=sxlijin@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).