Re: [git-users] commit or no commit

2018-04-03 Thread Michael

On 2018-04-03, at 3:08 PM, KrzyJaski  wrote:

> After
> git status
> 
> I got this message:
> Changes to be committed:
>   (use "git reset HEAD ..." to unstage)
> 
> modified:   root/node/chnode.c
> modified:   root/node/node.c
> 
> Changes not staged for commit:
>   (use "git add ..." to update what will be committed)
>   (use "git checkout -- ..." to discard changes in working directory)
> 
> modified:   root/node/chnode.c
> 
> The same file appears twice. How to understand this?

The file may have been modified after you checked it in for the commit. Or, 
your GUI might have committed some of the lines that were modified, and not all 
of the lines that were modified.

> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

---
Entertaining minecraft videos
http://YouTube.com/keybounce

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] commit or no commit

2018-04-03 Thread KrzyJaski
After
git status

I got this message:
Changes to be committed:
  (use "git reset HEAD ..." to unstage)

modified:   root/node/chnode.c
modified:   root/node/node.c

Changes not staged for commit:
  (use "git add ..." to update what will be committed)
  (use "git checkout -- ..." to discard changes in working directory)

modified:   root/node/chnode.c

The same file appears twice. How to understand this?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Environment expansion in .gitconfig?

2018-04-03 Thread Magnus Therning


Michael McNeil Forbes  writes:

On Apr 3, 2018, at 12:07 PM, Magnus Therning 
 wrote:



Michael Forbes  writes:


Hi,

I am trying to find a good solution to this use-case that 
seems to require

expansion in the .gitconfig file:

1. Multiple users share the same account on a machine (this is 
using CoCalc
 where the user is the project id so 
changing this is

not an option).
2. We would like to be able to use git, but with proper 
recording of which

user made the commit.

I work this with mercurial by having each user set an 
environment variable
when they log in, and then adding the following to the project 
.hgrc file:


[ui]
username = $LC_HG_USERNAME

This fails in the .gitconfig file as expansion is not 
performed

.
A workaround suggested there is to do something like this in 
the .bashrc

file:

git config --global user.name=$LC_GIT_USERNAME


This means, however, that all commits will be logged as the 
last user who
logged in - which mucks up the use case where multiple people 
might be

logged in at the same time.

Any suggestions for how to get git to work nicely in this 
case?


If I understand you correctly you rely on the logged in user 
setting

$LC_GIT_USERNAME properly, how is that done?

If it's done using some script, maybe you can simply modify 
that script

to *create* the proper ~/.gitconfig at the same time?


The user sets LC_GIT_USERNAME properly on their own computer, 
then
when they ssh to the shared machine, this variable is passed 
through

by ssh. Each user on the shared machine thus has an appropriate
LC_GIT_USERNAME in their environment that I want git to use. If 
anyone
modifies ~/.gitconfig on the shared machine, then it will affect 
all

users, so that is not a good option.


Oh, so it's a requirement that more than one user can be logged in 
at a

time, on the same account, and having different settings for
`ui.username`?

You can direct `git` to a specific configuration file using
`$GIT_CONFIG`. So an option would be to set it based on
`$LC_GIT_USERNAME` upon login (you can create the configuration
automatically on login too, if you want to.)

/M

--
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

It is better to keep your mouth shut and appear stupid than to 
open it

and remove all doubt.
— Mark Twain

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [git-users] Environment expansion in .gitconfig?

2018-04-03 Thread Michael McNeil Forbes

> On Apr 3, 2018, at 12:07 PM, Magnus Therning  wrote:
> 
> 
> Michael Forbes  writes:
> 
>> Hi,
>> 
>> I am trying to find a good solution to this use-case that seems to require
>> expansion in the .gitconfig file:
>> 
>> 1. Multiple users share the same account on a machine (this is using CoCalc
>>  where the user is the project id so changing this is
>> not an option).
>> 2. We would like to be able to use git, but with proper recording of which
>> user made the commit.
>> 
>> I work this with mercurial by having each user set an environment variable
>> when they log in, and then adding the following to the project .hgrc file:
>> 
>> [ui]
>> username = $LC_HG_USERNAME
>> 
>> This fails in the .gitconfig file as expansion is not performed
>> .
>> A workaround suggested there is to do something like this in the .bashrc
>> file:
>> 
>> git config --global user.name=$LC_GIT_USERNAME
>> 
>> 
>> This means, however, that all commits will be logged as the last user who
>> logged in - which mucks up the use case where multiple people might be
>> logged in at the same time.
>> 
>> Any suggestions for how to get git to work nicely in this case?
> 
> If I understand you correctly you rely on the logged in user setting
> $LC_GIT_USERNAME properly, how is that done?
> 
> If it's done using some script, maybe you can simply modify that script
> to *create* the proper ~/.gitconfig at the same time?

The user sets LC_GIT_USERNAME properly on their own computer, then when they 
ssh to the shared machine, this variable is passed through by ssh.  Each user 
on the shared machine thus has an appropriate LC_GIT_USERNAME in their 
environment that I want git to use.  If anyone modifies ~/.gitconfig on the 
shared machine, then it will affect all users, so that is not a good option.


-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Environment expansion in .gitconfig?

2018-04-03 Thread Magnus Therning


Michael Forbes  writes:


Hi,

I am trying to find a good solution to this use-case that seems 
to require

expansion in the .gitconfig file:

1. Multiple users share the same account on a machine (this is 
using CoCalc
 where the user is the project id so changing 
this is

not an option).
2. We would like to be able to use git, but with proper 
recording of which

user made the commit.

I work this with mercurial by having each user set an 
environment variable
when they log in, and then adding the following to the project 
.hgrc file:


[ui]
username = $LC_HG_USERNAME

This fails in the .gitconfig file as expansion is not performed
.
A workaround suggested there is to do something like this in the 
.bashrc

file:

git config --global user.name=$LC_GIT_USERNAME


This means, however, that all commits will be logged as the last 
user who
logged in - which mucks up the use case where multiple people 
might be

logged in at the same time.

Any suggestions for how to get git to work nicely in this case?


If I understand you correctly you rely on the logged in user 
setting

$LC_GIT_USERNAME properly, how is that done?

If it's done using some script, maybe you can simply modify that 
script

to *create* the proper ~/.gitconfig at the same time?

/M

--
Magnus Therning  OpenPGP: 0x927912051716CE39
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus

Sometimes I wonder whether the world is being run by smart people 
who

are putting us on or by imbeciles who really mean it.
— Mark Twain
Clearly, it's the imbeciles. And they really mean it.
— DBT

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature