nodegit / nodegit/nodegit

Discrepancy while making the first push to a remote

Open
#1,563 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

System information

  • node version: 8.9.3
  • npm or yarn version: 6.4.1
  • OS/version/architechture: Win10 - 64 bit
  • Applicable nodegit version: 0.22.2 ia32
node -v
npm -v # (or yarn -v)
node -e "console.log(process.platform)"
node -e "console.log(require('os').release())"
node -e "console.log(console.log(process.arch))"

I am creating a new git repo using the example at https://github.com/nodegit/nodegit/blob/master/examples/push.js . I am also creating a "remote" locally by creating a bare repository in another folder and pointing to this folder while creating the remote.

All the steps pass successfully but on git status I find the output as

On branch master
nothing to commit, working tree clean

and git log as

commit add9654497514765a07f40e85f2413e9fa7cfe77 (HEAD -> master, origin/master)
Author: <the author>
Date:   Sun Oct 7 21:10:42 2018 +0530

    Initial Commit

Notice how Git log mentioned the origin.

So, while debugging, I pushed the local repository and checked the git status again and voila, it showed:

On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

The git log remained the same as before.

So, I checked what changed in my .git folder before and after the push. And I found that the config file inside the .git folder had changed from

[core]
	bare = false
	repositoryformatversion = 0
	filemode = false
	symlinks = false
	ignorecase = true
	logallrefupdates = true
[remote "origin"]
	url = my-path/Repo.git/
	fetch = +refs/heads/*:refs/remotes/origin/*

to

[core]
	bare = false
	repositoryformatversion = 0
	filemode = false
	symlinks = false
	ignorecase = true
	logallrefupdates = true
[remote "origin"]
	url = my-path/Repo.git/
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

What is happening here? Is this a bug?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/push.js and compare the repository configuration before and after the first push, especially the [branch "master"] section shown in the report. Determine whether the missing tracking configuration is expected behavior or a NodeGit bug, and document the cause and a reproducible outcome.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, javascript, node.js
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.