* What does this output of git supposed to mean ?
@ 2017-06-05 14:04 Kaartic Sivaraam
2017-06-05 23:10 ` brian m. carlson
0 siblings, 1 reply; 17+ messages in thread
From: Kaartic Sivaraam @ 2017-06-05 14:04 UTC (permalink / raw)
To: git
Hello all,
I noticed a weird output by git when trying to run 'git status' on a
newly initialized git repository. It prints the following,
> On branch master
>
> Initial commit
>
> nothing to commit (create/copy files and use "git add" to track)
What's that "Initial commit" supposed to mean?
--
Regards,
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-05 14:04 What does this output of git supposed to mean ? Kaartic Sivaraam @ 2017-06-05 23:10 ` brian m. carlson 2017-06-05 23:18 ` Stefan Beller 0 siblings, 1 reply; 17+ messages in thread From: brian m. carlson @ 2017-06-05 23:10 UTC (permalink / raw) To: Kaartic Sivaraam; +Cc: git [-- Attachment #1: Type: text/plain, Size: 854 bytes --] On Mon, Jun 05, 2017 at 07:34:12PM +0530, Kaartic Sivaraam wrote: > Hello all, > > I noticed a weird output by git when trying to run 'git status' on a > newly initialized git repository. It prints the following, > > > On branch master > > > > Initial commit > > > > nothing to commit (create/copy files and use "git add" to track) > > > What's that "Initial commit" supposed to mean? It just means that it will be the first commit in the repository. It's a helpful reminder that some operations (such as git log) won't work as expected. In addition, many people want to commit certain files (such as .gitignore) in their initial commit, and this may jog their memory. -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 868 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-05 23:10 ` brian m. carlson @ 2017-06-05 23:18 ` Stefan Beller 2017-06-06 1:00 ` Junio C Hamano 0 siblings, 1 reply; 17+ messages in thread From: Stefan Beller @ 2017-06-05 23:18 UTC (permalink / raw) To: brian m. carlson, Kaartic Sivaraam, git@vger.kernel.org On Mon, Jun 5, 2017 at 4:10 PM, brian m. carlson <sandals@crustytoothpaste.net> wrote: > On Mon, Jun 05, 2017 at 07:34:12PM +0530, Kaartic Sivaraam wrote: >> Hello all, >> >> I noticed a weird output by git when trying to run 'git status' on a >> newly initialized git repository. It prints the following, >> >> > On branch master >> > >> > Initial commit >> > >> > nothing to commit (create/copy files and use "git add" to track) >> >> >> What's that "Initial commit" supposed to mean? > > It just means that it will be the first commit in the repository. It's > a helpful reminder that some operations (such as git log) won't work as > expected. In addition, many people want to commit certain files (such > as .gitignore) in their initial commit, and this may jog their memory. Tangent: For any personal project (or git repository that I start) I find myself doing one of the following: 1) I think about implications of the git history. And from what I understand there are a couple of issues with the very first commit (e.g. interactive rebase needs special flags to start from the 0-th commit) In this case I run git commit --allow-empty -m "initial commit" first and then proceed doing whatever 2. I do not think about history, so the first commit is a git commit -a -m "I made a shiny thing", ignoring any advice git gave me... On the subject: maybe we want to rename initial commit to root commit? (evil-me also thinks we could name it "parent-less commit", to reinforce what the lovely git man page generator tries to point at.) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-05 23:18 ` Stefan Beller @ 2017-06-06 1:00 ` Junio C Hamano 2017-06-06 1:11 ` brian m. carlson 0 siblings, 1 reply; 17+ messages in thread From: Junio C Hamano @ 2017-06-06 1:00 UTC (permalink / raw) To: Stefan Beller; +Cc: brian m. carlson, Kaartic Sivaraam, git@vger.kernel.org Stefan Beller <sbeller@google.com> writes: > On the subject: maybe we want to rename initial commit > to root commit? (evil-me also thinks we could name it > "parent-less commit", to reinforce what the lovely git man > page generator tries to point at.) Is "initial" harder to understand than "root" or "parent-less"? ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 1:00 ` Junio C Hamano @ 2017-06-06 1:11 ` brian m. carlson 2017-06-06 1:39 ` Samuel Lijin 0 siblings, 1 reply; 17+ messages in thread From: brian m. carlson @ 2017-06-06 1:11 UTC (permalink / raw) To: Junio C Hamano; +Cc: Stefan Beller, Kaartic Sivaraam, git@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 818 bytes --] On Tue, Jun 06, 2017 at 10:00:12AM +0900, Junio C Hamano wrote: > Stefan Beller <sbeller@google.com> writes: > > > On the subject: maybe we want to rename initial commit > > to root commit? (evil-me also thinks we could name it > > "parent-less commit", to reinforce what the lovely git man > > page generator tries to point at.) > > Is "initial" harder to understand than "root" or "parent-less"? I personally think that "Initial commit" is very straightforward. If we get more inquiries about it, we could consider changing it, but seeing as this is the first question I've ever seen about it, I think most people understand it pretty well. -- brian m. carlson / brian with sandals: Houston, Texas, US https://www.crustytoothpaste.net/~bmc | My opinion only OpenPGP: https://keybase.io/bk2204 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 868 bytes --] ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 1:11 ` brian m. carlson @ 2017-06-06 1:39 ` Samuel Lijin 2017-06-06 1:52 ` Junio C Hamano 0 siblings, 1 reply; 17+ messages in thread From: Samuel Lijin @ 2017-06-06 1:39 UTC (permalink / raw) To: brian m. carlson, Junio C Hamano, Stefan Beller, Kaartic Sivaraam, git@vger.kernel.org On Mon, Jun 5, 2017 at 9:11 PM, brian m. carlson <sandals@crustytoothpaste.net> wrote: > On Tue, Jun 06, 2017 at 10:00:12AM +0900, Junio C Hamano wrote: >> Stefan Beller <sbeller@google.com> writes: >> >> > On the subject: maybe we want to rename initial commit >> > to root commit? (evil-me also thinks we could name it >> > "parent-less commit", to reinforce what the lovely git man >> > page generator tries to point at.) >> >> Is "initial" harder to understand than "root" or "parent-less"? > > I personally think that "Initial commit" is very straightforward. If we > get more inquiries about it, we could consider changing it, but seeing > as this is the first question I've ever seen about it, I think most > people understand it pretty well. For what it's worth, I've never quite understood the "Initial commit" message, because the repository is in a state where there are no commits yet, not when HEAD is pointing to a root commit. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 1:39 ` Samuel Lijin @ 2017-06-06 1:52 ` Junio C Hamano 2017-06-06 2:06 ` David 0 siblings, 1 reply; 17+ messages in thread From: Junio C Hamano @ 2017-06-06 1:52 UTC (permalink / raw) To: Samuel Lijin Cc: brian m. carlson, Stefan Beller, Kaartic Sivaraam, git@vger.kernel.org Samuel Lijin <sxlijin@gmail.com> writes: > For what it's worth, I've never quite understood the "Initial commit" > message, because the repository is in a state where there are no > commits yet, not when HEAD is pointing to a root commit. Ah, that is true. The message in the "status" output attempts to tell you that you are about to make the "initial commit", because "status" was not originally a thing (it was just the message when "git commit" gives you while you compose the commit log message). In the context of "status", it probably is more logically correct if it said "No commit yet" or something. This is no longer "is initial harder than root?" ;-) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 1:52 ` Junio C Hamano @ 2017-06-06 2:06 ` David 2017-06-06 11:07 ` Philip Oakley 0 siblings, 1 reply; 17+ messages in thread From: David @ 2017-06-06 2:06 UTC (permalink / raw) To: Junio C Hamano Cc: Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git@vger.kernel.org On 6 June 2017 at 11:52, Junio C Hamano <gitster@pobox.com> wrote: > Samuel Lijin <sxlijin@gmail.com> writes: > >> For what it's worth, I've never quite understood the "Initial commit" >> message, because the repository is in a state where there are no >> commits yet, not when HEAD is pointing to a root commit. > > In the context of "status", it probably is more logically correct if > it said "No commit yet" or something. This is no longer "is initial > harder than root?" ;-) Exactly. I agree with OP, in the context of running 'git status', I find the string "Initial commit" confusing in the example below, because at that time no commits exist. This creates confusion what git is talking about. The 'git log' message is not very friendly either. Perhaps say something like "Repository is empty." there. $ mkdir test $ cd test $ git init Initialized empty Git repository in /mnt/hart/home/david_d08/junk/test/.git/ $ git log fatal: bad default revision 'HEAD' $ git status On branch master Initial commit nothing to commit (create/copy files and use "git add" to track) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 2:06 ` David @ 2017-06-06 11:07 ` Philip Oakley 2017-06-06 11:43 ` SZEDER Gábor 2017-06-06 11:52 ` Junio C Hamano 0 siblings, 2 replies; 17+ messages in thread From: Philip Oakley @ 2017-06-06 11:07 UTC (permalink / raw) To: David, Junio C Hamano Cc: Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git From: "David" <bouncingcats@gmail.com> > On 6 June 2017 at 11:52, Junio C Hamano <gitster@pobox.com> wrote: >> Samuel Lijin <sxlijin@gmail.com> writes: >> >>> For what it's worth, I've never quite understood the "Initial commit" >>> message, because the repository is in a state where there are no >>> commits yet, not when HEAD is pointing to a root commit. >> >> In the context of "status", it probably is more logically correct if >> it said "No commit yet" or something. This is no longer "is initial >> harder than root?" ;-) > > Exactly. I agree with OP, in the context of running 'git status', I find > the string "Initial commit" confusing in the example below, because > at that time no commits exist. This creates confusion what git is > talking about. The 'git log' message is not very friendly either. > > Perhaps say something like "Repository is empty." there. <bikeshed> I like that. I think that is a very appropriately descriptive statement. An alternative ,with slightly less textual change, could be "Waiting for initial commit" </bikeshed> > > $ mkdir test > $ cd test > $ git init > Initialized empty Git repository in > /mnt/hart/home/david_d08/junk/test/.git/ > $ git log > fatal: bad default revision 'HEAD' > $ git status > On branch master > > Initial commit > > nothing to commit (create/copy files and use "git add" to track) ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 11:07 ` Philip Oakley @ 2017-06-06 11:43 ` SZEDER Gábor 2017-06-06 18:42 ` Jeff King 2017-06-06 11:52 ` Junio C Hamano 1 sibling, 1 reply; 17+ messages in thread From: SZEDER Gábor @ 2017-06-06 11:43 UTC (permalink / raw) To: Philip Oakley Cc: SZEDER Gábor, David, Junio C Hamano, Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git > >> In the context of "status", it probably is more logically correct if > >> it said "No commit yet" or something. This is no longer "is initial > >> harder than root?" ;-) > > > > Exactly. I agree with OP, in the context of running 'git status', I find > > the string "Initial commit" confusing in the example below, because > > at that time no commits exist. This creates confusion what git is > > talking about. The 'git log' message is not very friendly either. > > > > Perhaps say something like "Repository is empty." there. > > <bikeshed> > I like that. I think that is a very appropriately descriptive statement. > > An alternative ,with slightly less textual change, could be "Waiting for > initial commit" > </bikeshed> We should consider orphan/unborn branches, too: git (master)$ git checkout --orphan newroot Switched to a new branch 'newroot' git (newroot +)$ git reset --hard git (newroot #)$ git status On branch newroot Initial commit nothing to commit (create/copy files and use "git add" to track) A purely textual change will not be sufficient, I'm afraid. Saying "Repository is empty" right after 'git init' is fine, I like it. However, on an unborn branch with empty index it would be just wrong. "Waiting for initial commit" is much better even in this case, but I still don't like that "initial", though I can't say why, and don't have any better suggestion either. Though users experienced enough to create an empty unborn branch would probably not be confused by that. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 11:43 ` SZEDER Gábor @ 2017-06-06 18:42 ` Jeff King 2017-06-06 18:53 ` Jeff King 0 siblings, 1 reply; 17+ messages in thread From: Jeff King @ 2017-06-06 18:42 UTC (permalink / raw) To: SZEDER Gábor Cc: Philip Oakley, David, Junio C Hamano, Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git On Tue, Jun 06, 2017 at 01:43:55PM +0200, SZEDER Gábor wrote: > > An alternative ,with slightly less textual change, could be "Waiting for > > initial commit" > > </bikeshed> > > We should consider orphan/unborn branches, too: > > git (master)$ git checkout --orphan newroot > Switched to a new branch 'newroot' > git (newroot +)$ git reset --hard > git (newroot #)$ git status > On branch newroot > > Initial commit > > nothing to commit (create/copy files and use "git add" to track) > > A purely textual change will not be sufficient, I'm afraid. Saying > "Repository is empty" right after 'git init' is fine, I like it. > However, on an unborn branch with empty index it would be just wrong. > > "Waiting for initial commit" is much better even in this case, but I > still don't like that "initial", though I can't say why, and don't > have any better suggestion either. Though users experienced enough to > create an empty unborn branch would probably not be confused by that. I agree. If the state we are describing is limited to the current branch, how about saying so? Like "Your current branch has no commits". -Peff ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 18:42 ` Jeff King @ 2017-06-06 18:53 ` Jeff King 0 siblings, 0 replies; 17+ messages in thread From: Jeff King @ 2017-06-06 18:53 UTC (permalink / raw) To: SZEDER Gábor Cc: Philip Oakley, David, Junio C Hamano, Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git On Tue, Jun 06, 2017 at 02:42:01PM -0400, Jeff King wrote: > > "Waiting for initial commit" is much better even in this case, but I > > still don't like that "initial", though I can't say why, and don't > > have any better suggestion either. Though users experienced enough to > > create an empty unborn branch would probably not be confused by that. > > I agree. If the state we are describing is limited to the current > branch, how about saying so? Like "Your current branch has no commits". Actually, something like "does not yet have any commits" might be better. There is a slight complication, though. There's similar text in "git status -sb", which shows: ## Initial commit on master Should that also change to use consistent terminology? If so, we need a phrasing short phrasing that matches (and the --porcelain and --porcelain=v2 formats of course would need to remain the same). -Peff ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 11:07 ` Philip Oakley 2017-06-06 11:43 ` SZEDER Gábor @ 2017-06-06 11:52 ` Junio C Hamano 2017-06-06 14:08 ` Kaartic Sivaraam 1 sibling, 1 reply; 17+ messages in thread From: Junio C Hamano @ 2017-06-06 11:52 UTC (permalink / raw) To: Philip Oakley Cc: David, Samuel Lijin, brian m. carlson, Stefan Beller, Kaartic Sivaraam, git "Philip Oakley" <philipoakley@iee.org> writes: > From: "David" <bouncingcats@gmail.com> > >> Perhaps say something like "Repository is empty." there. > > <bikeshed> > I like that. I think that is a very appropriately descriptive statement. > > An alternative ,with slightly less textual change, could be "Waiting > for initial commit" > </bikeshed> I can buy that one. I do not want to see "Repository is empty", as that will open us up to criticism that we are being sloppy and technically incorrect to cater to newbies (i.e. we will give the message if you do "checkout --orphan", and repository is definitely not empty in that case). "Waiting for the initial commit", or "No commits yet", can be explained to describe the state of the current branch (not the state of the repository), and it is correct that we do not have any commit on the branch, and the branch is waiting for the initial commit. ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 11:52 ` Junio C Hamano @ 2017-06-06 14:08 ` Kaartic Sivaraam 2017-06-06 22:05 ` Philip Oakley 0 siblings, 1 reply; 17+ messages in thread From: Kaartic Sivaraam @ 2017-06-06 14:08 UTC (permalink / raw) To: Junio C Hamano, Philip Oakley Cc: David, Samuel Lijin, brian m. carlson, Stefan Beller, git On Tue, 2017-06-06 at 20:52 +0900, Junio C Hamano wrote: > "Waiting for the initial commit", or "No commits yet", can be > explained to describe the state of the current branch (not the state > of the repository), and it is correct that we do not have any commit > on the branch, and the branch is waiting for the initial commit. > Looks descriptive to me too. Just for the note, I wouldn't have asked this question if `git status` showed a message like this. -- Regards, Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 14:08 ` Kaartic Sivaraam @ 2017-06-06 22:05 ` Philip Oakley 2017-06-07 12:56 ` Kaartic Sivaraam 0 siblings, 1 reply; 17+ messages in thread From: Philip Oakley @ 2017-06-06 22:05 UTC (permalink / raw) To: Kaartic Sivaraam, Junio C Hamano Cc: David, Samuel Lijin, brian m. carlson, Stefan Beller, git From: "Kaartic Sivaraam" <kaarticsivaraam91196@gmail.com> > On Tue, 2017-06-06 at 20:52 +0900, Junio C Hamano wrote: >> "Waiting for the initial commit", or "No commits yet", can be >> explained to describe the state of the current branch (not the state >> of the repository), and it is correct that we do not have any commit >> on the branch, and the branch is waiting for the initial commit. >> > Looks descriptive to me too. Just for the note, I wouldn't have asked > this question if `git status` showed a message like this. > Maybe have a try at a patch to update the text? See the git/Documentation/SubmittingPatches for guidance. > -- > Regards, > Kaartic Sivaraam <kaarticsivaraam91196@gmail.com> ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-06 22:05 ` Philip Oakley @ 2017-06-07 12:56 ` Kaartic Sivaraam 2017-06-07 22:14 ` Philip Oakley 0 siblings, 1 reply; 17+ messages in thread From: Kaartic Sivaraam @ 2017-06-07 12:56 UTC (permalink / raw) To: Philip Oakley, Junio C Hamano Cc: David, Samuel Lijin, brian m. carlson, Stefan Beller, git On Wednesday 07 June 2017 03:35 AM, Philip Oakley wrote: > Maybe have a try at a patch to update the text? See the > git/Documentation/SubmittingPatches for guidance. I guess this should be trivial (correct me if I'm wrong). I'll try when I find time. In case I make the change which of the following message should replace the message 'Initial commit' ? (this could be a poll, I guess) 1. No commit yet 2. Waiting for initial commit 3. Your current branch does not have any commits Further what is to be done about the following comment, On Wednesday 07 June 2017 12:23 AM, Jeff King wrote: There is a slight complication, though. There's similar text in "git status -sb", which shows: ## Initial commit on master Should that also change to use consistent terminology? If so, we need a phrasing short phrasing that matches (and the --porcelain and --porcelain=v2 formats of course would need to remain the same). BTW, could anyone provide a pointer to the implementation that prints this message ? -- Regards, Kaartic Sivaraam ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: What does this output of git supposed to mean ? 2017-06-07 12:56 ` Kaartic Sivaraam @ 2017-06-07 22:14 ` Philip Oakley 0 siblings, 0 replies; 17+ messages in thread From: Philip Oakley @ 2017-06-07 22:14 UTC (permalink / raw) To: Kaartic Sivaraam Cc: David, Samuel Lijin, brian m. carlson, Stefan Beller, git, Junio C Hamano From: "Kaartic Sivaraam" <kaarticsivaraam91196@gmail.com> > On Wednesday 07 June 2017 03:35 AM, Philip Oakley wrote: >> Maybe have a try at a patch to update the text? See the >> git/Documentation/SubmittingPatches for guidance. > I guess this should be trivial (correct me if I'm wrong). I'll try when I > find time. In case I make the change which of the following message should > replace the message 'Initial commit' ? (this could be a poll, I guess) > > 1. No commit yet > 2. Waiting for initial commit > 3. Your current branch does not have any commits 2, or 3, or a mix of the two "current branch waiting for initial commit" maybe. > > Further what is to be done about the following comment, > > On Wednesday 07 June 2017 12:23 AM, Jeff King wrote: > > There is a slight complication, though. There's similar text in "git > status -sb", which shows: ## Initial commit on master Should that also > change to use consistent terminology? If so, we need a phrasing short > phrasing that matches (and the --porcelain and --porcelain=v2 formats of > course would need to remain the same). > > BTW, could anyone provide a pointer to the implementation that prints this > message ? I think the two messages are in wt-status.c with the simple "Initial commit" at ~L1560, while ~L1728 has the "Initial commit on" line. Philip > > -- > Regards, > Kaartic Sivaraam ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-06-07 22:14 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-06-05 14:04 What does this output of git supposed to mean ? Kaartic Sivaraam 2017-06-05 23:10 ` brian m. carlson 2017-06-05 23:18 ` Stefan Beller 2017-06-06 1:00 ` Junio C Hamano 2017-06-06 1:11 ` brian m. carlson 2017-06-06 1:39 ` Samuel Lijin 2017-06-06 1:52 ` Junio C Hamano 2017-06-06 2:06 ` David 2017-06-06 11:07 ` Philip Oakley 2017-06-06 11:43 ` SZEDER Gábor 2017-06-06 18:42 ` Jeff King 2017-06-06 18:53 ` Jeff King 2017-06-06 11:52 ` Junio C Hamano 2017-06-06 14:08 ` Kaartic Sivaraam 2017-06-06 22:05 ` Philip Oakley 2017-06-07 12:56 ` Kaartic Sivaraam 2017-06-07 22:14 ` Philip Oakley
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).