[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git: how to figure out with a script what the last commit on remote repo is without fetching it



Joel Rees <joel.rees@gmail.com> writes:

>> 2014/09/21 12:15 "lee" <lee@yun.yagibdah.de>:
>> If there were diffs shown, only the local diffs would show up.
>> [...]
>
> Because your branch and origin/master have diverged. (Talking about HEAD
> was misleading. I still get cvs/svn and git confused in this way. Sorry
> about that)

Afaik git never shows diffs to another copy of the repo than the one
you're working in.  Perhaps you can somehow force it to do that; I
wouldn't know how to.

Nothing has diverged.  I have committed my changes to my copy of the
repo.  I don't understand why 'git status' would suddenly involve
another copy of the repo --- if that's what it actually does.

If it does, 'git status' is buggy for all instances in which all other
repos are copies of my copy or copies of copies of my copy, i. e. when
the repo was "born" on my computer --- unless maybe if I could somehow
tell git that my copy of the repo is the "origin".

> Can't explain now because I'm in a church meeting. But see if you can find
> the instructions to bring your branch up to origin/master. As it says, you
> need to do a pull/merge, and that takes some care. Sometimes I just dump a
> repository and start fresh I let this happen. (Keep the old one around to
> make sure you don't lose track of your modifications.)

I can just run 'git pull' on the emacs repo.  Changes are to hilock.el
of which I have my own repo --- these changes have been provided as a
patch into the emacs bug tracking months ago and been ignored.  Another
change is to disable some code which they put in to find problems in
elisp packages, and that's only commenting out one line and inserting a
"return" instead.

At worst, I'll get some merge conflicts:


,----
| [~/inst/emacs/emacs-git/emacs] git pull
| remote: Counting objects: 866, done.
| remote: Compressing objects: 100% (612/612), done.
| remote: Total 612 (delta 522), reused 0 (delta 0)
| Receiving objects: 100% (612/612), 105.65 KiB | 0 bytes/s, done.
| Resolving deltas: 100% (522/522), completed with 157 local objects.
| From git://git.savannah.gnu.org/emacs
|    567e68d..891097c  master     -> origin/master
|    a732b06..9dfb31b  emacs-24   -> origin/emacs-24
|    567e68d..891097c  trunk      -> origin/trunk
| Waiting for Emacs...
| Merge made by the 'recursive' strategy.
| [...]
|  170 files changed, 4583 insertions(+), 2148 deletions(-)
|  create mode 100644 test/indent/scheme.scm
| [~/inst/emacs/emacs-git/emacs]
`----


That goes without conflicts.


,----
| [~/inst/emacs/emacs-git/emacs] git diff
| [~/inst/emacs/emacs-git/emacs] 
`----


'git diff' will only show output when I modify a file and haven't
committed the change yet.  It doesn't refer to any other copies of the
repo.


-- 
Knowledge is volatile and fluid.  Software is power.


Reply to: