# found some code...

5 messages from 2012-01-18 to 2012-01-18. Participants: Ron Eggler, Andrew Ardill, Holger Hellmuth.
Thread: https://gitlist.dev/t/29388

## Ron Eggler, 2012-01-18 01:02

Subject: found some code...
Message-ID: <loom.20120118T015734-175@post.gmane.org>
URL: https://gitlist.dev/e/loom.20120118T015734-175%40post.gmane.org

```
Hi There,

Some mishap had happened with my project:
I found a piece of code that is the most recent one that never got commited to
the repository. It is dated December 5th and it definitely is the most recent 
piece of code. 
Now in the mean time I switched computers so I had to reinstall git and get
create new local folders. Now this directory with the most recent code, shows
every file as unversioned which should not be true. 
Only a couple, maybe 3 files had changed with that last change. Now when I commit
this now, is that gonna mess up my old repo or can I safely gio ahead and commit
that most recent code (even tho it might commit the whole folder) - it almost
seems like it forgot which files
were in the repo vs. which files were in my local folder...

Thanks for hints and suggestions how I get myself cleanly out of this mess!
Thanks,
Ron

```

## Andrew Ardill, 2012-01-18 01:16

Subject: Re: found some code...
Message-ID: <CAH5451k4bMJtMLsaFi6g_uRGTL0OdQ5Z1Pss3xuMdWYs+6VcLQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAH5451k4bMJtMLsaFi6g_uRGTL0OdQ5Z1Pss3xuMdWYs%2B6VcLQ%40mail.gmail.com
In-Reply-To: <loom.20120118T015734-175@post.gmane.org>

```
Hi Ron,

On 18 January 2012 12:02, Ron Eggler <ron.eggler@gmail.com> wrote:
> Hi There,
>
> Some mishap had happened with my project:
> I found a piece of code that is the most recent one that never got commited to
> the repository. It is dated December 5th and it definitely is the most recent
> piece of code.
> Now in the mean time I switched computers so I had to reinstall git and get
> create new local folders. Now this directory with the most recent code, shows
> every file as unversioned which should not be true.
> Only a couple, maybe 3 files had changed with that last change. Now when I commit
> this now, is that gonna mess up my old repo or can I safely gio ahead and commit
> that most recent code (even tho it might commit the whole folder) - it almost
> seems like it forgot which files
> were in the repo vs. which files were in my local folder...
>
> Thanks for hints and suggestions how I get myself cleanly out of this mess!
> Thanks,
> Ron
>

Out of interest, how did you transfer the existing code onto the new
machine? In particular, did you clone the existing repository using
git clone, or using some other method (such as zipping/emailing)? If
it was not via clone, did you copy the .git subdirectory, or did you
recreate it?

Is the old repository (on the old computer) still available?

Regards,

Andrew Ardill

```

## Ron Eggler, 2012-01-18 02:49

Subject: Re: found some code...
Message-ID: <2918969.0SyTOLELv0@reg-desktop>
URL: https://gitlist.dev/e/2918969.0SyTOLELv0%40reg-desktop
In-Reply-To: <CAH5451k4bMJtMLsaFi6g_uRGTL0OdQ5Z1Pss3xuMdWYs+6VcLQ@mail.gmail.com>

```
On January 18, 2012 12:16:49 PM Andrew Ardill wrote:
> Hi Ron,
> 
> On 18 January 2012 12:02, Ron Eggler <ron.eggler@gmail.com> wrote:
> > Hi There,
> > 
> > Some mishap had happened with my project:
> > I found a piece of code that is the most recent one that never got
> > commited to the repository. It is dated December 5th and it definitely
> > is the most recent piece of code.
> > Now in the mean time I switched computers so I had to reinstall git and
> > get create new local folders. Now this directory with the most recent
> > code, shows every file as unversioned which should not be true.
> > Only a couple, maybe 3 files had changed with that last change. Now when
> > I commit this now, is that gonna mess up my old repo or can I safely
> > gio ahead and commit that most recent code (even tho it might commit
> > the whole folder) - it almost seems like it forgot which files
> > were in the repo vs. which files were in my local folder...
> > 
> > Thanks for hints and suggestions how I get myself cleanly out of this
> > mess! Thanks,
> > Ron
> 
> Out of interest, how did you transfer the existing code onto the new
> machine? In particular, did you clone the existing repository using
> git clone, or using some other method (such as zipping/emailing)? If
> it was not via clone, did you copy the .git subdirectory, or did you
> recreate it?

I copied the whole directory (incl .git) onto a thumb drive.
 
> Is the old repository (on the old computer) still available?

No, unfortunately not
-- 
Ron

```

## Holger Hellmuth, 2012-01-18 09:56

Subject: Re: found some code...
Message-ID: <4F16973E.8040302@ira.uka.de>
URL: https://gitlist.dev/e/4F16973E.8040302%40ira.uka.de
In-Reply-To: <2918969.0SyTOLELv0@reg-desktop>

```
On 18.01.2012 03:49, Ron Eggler wrote:
> On January 18, 2012 12:16:49 PM Andrew Ardill wrote:
>> Hi Ron,
>>
>> On 18 January 2012 12:02, Ron Eggler<ron.eggler@gmail.com>  wrote:
>>> Hi There,
>>>
>>> Some mishap had happened with my project:
>>> I found a piece of code that is the most recent one that never got
>>> commited to the repository. It is dated December 5th and it definitely
>>> is the most recent piece of code.
>>> Now in the mean time I switched computers so I had to reinstall git and
>>> get create new local folders. Now this directory with the most recent
>>> code, shows every file as unversioned which should not be true.
>>> Only a couple, maybe 3 files had changed with that last change. Now when
>>> I commit this now, is that gonna mess up my old repo or can I safely
>>> gio ahead and commit that most recent code (even tho it might commit
>>> the whole folder) - it almost seems like it forgot which files
>>> were in the repo vs. which files were in my local folder...

Try "git update-index --refresh", more info in this recent thread 
"http://comments.gmane.org/gmane.comp.version-control.git/188291"

If this doesn't help:
Human language is very ambiguous. What do you mean by "found a piece of 
code"? Somewhere outside the repository, in a branch inside the 
repository, in a subdirectory?
What do you mean by "get create new local folders"? Do you mean a folder 
where you copied the repository or do you mean folders inside your 
repository where you created new files with your editor?

```

## Holger Hellmuth, 2012-01-18 22:45

Subject: Re: found some code...
Message-ID: <4F174BA0.2040109@ira.uka.de>
URL: https://gitlist.dev/e/4F174BA0.2040109%40ira.uka.de
In-Reply-To: <CAHxBh_QiZzJP2jS6rMpC1c=P8uXSbFWumbcnHj3ArkQB4sXyPQ@mail.gmail.com>

```
Mmh, your reply here didn't make it to the mailing list, maybe because 
it was multipart with html(??) or it just got lost.

Am 18.01.2012 18:57, schrieb Ron Eggler:
>     Try "git update-index --refresh", more info in this recent thread
>     "http://comments.gmane.org/__gmane.comp.version-control.__git/188291
>     <http://comments.gmane.org/gmane.comp.version-control.git/188291>"
>
>
> I got this outputand nothing really changed(generally using TortoiseGit
> on Windows but did this in the provided bash shell):
> $ git update-index --refresh
> MCU2.COF.txt: needs update
> MCU2.bak: needs update
> MCU2.c: needs update
> MCU2.esym: needs update
> MCU2.h: needs update
> MCU2.hex: needs update
> MCU2.lst: needs update
> MCU2.mcp: needs update
[...]

Ok, "needs update" seems to be the non-porcelain version of 'M' (why 'M' 
is more porcelain than "needs update" is a mystery to me ;-) respective 
"Changes not staged for commit" in git status.

Well, what does it say when you do "git diff MCU2.h" ? There are 2 
possibilities:

1) You see code differences. In that case you should be able to 
recognize where and when these changes were comitted or not.

2) You see no difference or every line is listed as different even 
though they seem to be equal. Possible reason is a mixup of line endings 
as git on windows has to convert \r\n line endings to \n line endings 
when it checks data in. This is controlled by config variables, and 
maybe your config is slightly wrong.

In that case I would create a new repo with git init in bash (not 
tortoise git!), and look at .git/config. Compare that with .git/config 
of your mixed up repo. Also compare with .git/config of the repo on your 
usb stick. As far as I know you should have core.autocrlf set to true on 
Windows.
Alternatively or for a complete picture you could do "git config -l" 
which gives you also global and system configuration variables if they 
exist.

Another possible reason would be file names with same name but different 
case. I mention this because there is a parallel thread on this mailing 
list with a problem with tortoise git and windows. See 
http://git.661346.n2.nabble.com/Bug-Git-checkout-fails-with-a-wrong-error-message-td7181244.html. 
As suggested in that thread you should have the option core.ignorecase set.


> Ok ,let's see:
> I "found" the piece of code on my thumbdrive and it ultimately is copied
> from my "old" working directory from the computer i don't have
> anymore... "get create new local folders" means that I actually created
> a new folder on my new machine and  cloned the repo from git into it so
> this would be my new working directory... now i have the code that
> should be in there seperatetely in the directory from the thumb drive....
> Does that make any more ssense?
>

```
