Re: [git-users] how to rename the master branch on sourceforge

2023-12-31 Thread Marios Pliatsikas
The error message you're seeing is because you're trying to delete the
branch that is currently checked out on the remote repository. Git prevents
this by default to avoid confusion and potential data loss.

The `receive.denyDeleteCurrent` configuration variable you're trying to set
is for the remote repository, not your local one. Setting it on your local
repository with `git config --local receive.denyDeleteCurrent ignore` won't
have any effect on the remote repository.

Unfortunately, SourceForge's Git service doesn't provide a way to directly
change this setting or to change the default branch via their web
interface, unlike some other Git hosting services like GitHub or GitLab.

Here's a workaround you can try:

1. Push your new branch to the remote repository, if you haven't already:

```bash
git push origin default
```

2. On your local machine, create a temporary branch and check it out:

```bash
git checkout -b temp
```

3. Push the temporary branch to the remote repository:

```bash
git push origin temp
```

4. On SourceForge, go to your project's Admin settings, then to the Tool
Configuration for Git. Set the default branch to `temp`.

5. Now you should be able to delete the `master` branch:

```bash
git push origin --delete master
```

6. Finally, go back to the Tool Configuration for Git on SourceForge and
change the default branch to `default`. You can then delete the `temp`
branch if you wish.

Remember to inform any collaborators to fetch the latest changes and switch
to the new default branch.

Στις Παρ 29 Δεκ 2023 στις 6:38 μ.μ., ο/η Uwe Brauer  έγραψε:

>
> Hi
>
> I just set up a sandbox (clone of the true repository)
>
> I tried out the following
>1. git branch -m master default
>2. Change the «gitlab-default» branch to something else
>
>3. git push origin --delete master
>
>4. git push origin -u default
>5. Set the default branch as «gitlab-default»
>
> However 3. Fails with
>
>
> ,
> | remote: error: By default, deleting the current branch is denied,
> because the next
> | remote: 'git clone' won't result in any file checked out, causing
> confusion.
> | remote:
> | remote: You can set 'receive.denyDeleteCurrent' configuration variable to
> | remote: 'warn' or 'ignore' in the remote repository to allow deleting the
> | remote: current branch, with or without a warning message.
> | remote:
> | remote: To squelch this message, you can set it to 'refuse'.
> | remote: error: refusing to delete the current branch: refs/heads/master
> | To ssh://git.code.sf.net/p/matlab-emacs-mirror/code
> |  ! [remote rejected] master (deletion of the current branch prohibited)
> | error: failed to push some refs to 'ssh://
> git.code.sf.net/p/matlab-emacs-mirror/code'
> `
>
> But I tried out
> git config --local receive.denyDeleteCurrent ignore
>
> And it did not help.
>
> Any idea what is going wrong here.
> On gitlab I have to change  the default branch form master to something
> else via their webinterface.
>
> I don't see anything like this on sourceforge.
>
> Any ideas?
>
> Regards
>
> Uwe
> --
> I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
> I strongly condemn Putin's war of aggression against Ukraine.
> I support to deliver weapons to Ukraine's military.
> I support the EU and NATO membership of Ukraine.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/87bka83o4a.fsf%40mat.ucm.es.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CA%2B-wtNtp6bh3qfMf4AyZxET7MBd__9vHWNieSxKkm7J%3DacJGqg%40mail.gmail.com.


[git-users] how to rename the master branch on sourceforge

2023-12-29 Thread Uwe Brauer

Hi

I just set up a sandbox (clone of the true repository)

I tried out the following 
   1. git branch -m master default
   2. Change the «gitlab-default» branch to something else

   3. git push origin --delete master

   4. git push origin -u default
   5. Set the default branch as «gitlab-default»

However 3. Fails with 


,
| remote: error: By default, deleting the current branch is denied, because the 
next
| remote: 'git clone' won't result in any file checked out, causing confusion.
| remote:
| remote: You can set 'receive.denyDeleteCurrent' configuration variable to
| remote: 'warn' or 'ignore' in the remote repository to allow deleting the
| remote: current branch, with or without a warning message.
| remote:
| remote: To squelch this message, you can set it to 'refuse'.
| remote: error: refusing to delete the current branch: refs/heads/master
| To ssh://git.code.sf.net/p/matlab-emacs-mirror/code
|  ! [remote rejected] master (deletion of the current branch prohibited)
| error: failed to push some refs to 
'ssh://git.code.sf.net/p/matlab-emacs-mirror/code'
`

But I tried out 
git config --local receive.denyDeleteCurrent ignore   

And it did not help.

Any idea what is going wrong here.
On gitlab I have to change  the default branch form master to something
else via their webinterface.

I don't see anything like this on sourceforge.

Any ideas?

Regards

Uwe 
-- 
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the EU and NATO membership of Ukraine. 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87bka83o4a.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread 凯夏
thank you, i will try this.

On Friday, November 17, 2023 at 8:26:29 PM UTC+8 Konstantin Khomoutov wrote:

> (Reformatted for the usual inline reply mode [1].)
>
> On Fri, Nov 17, 2023 at 02:09:11AM -0800, 凯夏 wrote:
>
> [...]
> >>> how can i merge test1 test2 into feature1?
> >>> e94e3c2 feature2
> >>> f509e6e test4
> >>> 9972849 test3
> >>> d7f2f97 feature1
> >>> 04ea2a1 test2
> >>> 1c0f590 test1
> >>> a777378 init
> >> 
> >> Before we continue... Is this just a list of assorted commits with no
> >> inherent ordering between them or is there a result of running `git 
> log`?
> >> 
> >> If it's the latter, feature2 appears to contain both test1 and test2 
> >> already.
> >>
> >> Oops, I wanted to say that feature1 appears to contain both test1 and
> >> test2, of course.
>
> > This is result of running git log.
> > My bad, the result i want is git log output like this:
> > yyy feature2
> > xxx feature1
> > a777378 init
> > x and y means this can change.
> > i just want to delete some unneeded commit to save space. 
> > because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
> > and feature1 maybe change 125 to 126, after merge,feature1 can just 
> chang 
> > 123 to 126.
>
> Do I understand correctly that you basically want the three changes
> introduced, sequencitally by the three commits
>
> e94e3c2 feature2
> f509e6e test4
> 9972849 test3
>
> to become a single commit (with the message "feature2"), and to do the same
> with the group
>
> d7f2f97 feature1
> 04ea2a1 test2
> 1c0f590 test1
>
> to produce a single commit (with the message "feature1")?
>
> That would indeed produce
>
> yyy feature2
> xxx feature1
> a777378 init
>
> as you have indicated.
>
>
> If yes, what you're after is called "squashing", which can be done during
> so-called "rebasing".
>
> Basically, you need to do the following:
>
> Run
>
> git rebase -i a777378
>
> to start an interactive (hence "-i") rebase of the current tip commit and
> whatever follows onto a777378.
>
> Git will pop out an editor with the so-called "rebase script".
> It will read something like
>
> pick 1c0f590 test1
> pick 04ea2a1 test2
> pick d7f2f97 feature1
> pick 9972849 test3
> pick f509e6e test4
> pick e94e3c2 feature2
>
> (Note the order reversed compared to that produced by `git log`.)
>
> You then change the verbs of the script to read
>
> pick 1c0f590 test1
> squash 04ea2a1 test2
> squash d7f2f97 feature1
> pick 9972849 test3
> squash f509e6e test4
> squash e94e3c2 feature2
>
> The modified script is meant to produce two commits by literally taking a 
> base
> commit for each group ("pick") and then "squash" the following two commits
> into it.
>
> You save the text and quit the editor, and the rebasing starts.
> It will stop twice - offering you to provide a commit message for each of 
> the
> commits to be created. You delete all the offered text to keep only those 
> of
> "feature1" and "feature2", respectively.
> After finishing each commit you run
>
> git rebase --continue
>
> until it says that it has done everything.
>
> Verify the result in the usual way (`git log`, `git show`, `gitk` etc).
>
> See [2] for more info.
>
> [1]: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
> [2]: https://git-scm.com/book/en/v2/Git-Branching-Rebasing
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/5d99ab3a-d895-463c-91f6-26797ee9a7e8n%40googlegroups.com.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread Konstantin Khomoutov
(Reformatted for the usual inline reply mode [1].)

On Fri, Nov 17, 2023 at 02:09:11AM -0800, 凯夏 wrote:

[...]
>>> how can i merge test1 test2 into feature1?
>>> e94e3c2 feature2
>>> f509e6e test4
>>> 9972849 test3
>>> d7f2f97 feature1
>>> 04ea2a1 test2
>>> 1c0f590 test1
>>> a777378 init
>> 
>> Before we continue... Is this just a list of assorted commits with no
>> inherent ordering between them or is there a result of running `git log`?
>> 
>> If it's the latter, feature2 appears to contain both test1 and test2 
>> already.
>>
>> Oops, I wanted to say that feature1 appears to contain both test1 and
>> test2, of course.

> This is result of running git log.
> My bad, the result i want is git log output like this:
> yyy feature2
> xxx feature1
> a777378 init
> x and y means this can change.
> i just want to delete some unneeded commit to save space. 
> because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
> and feature1 maybe change 125 to 126, after merge,feature1 can just chang 
> 123 to 126.

Do I understand correctly that you basically want the three changes
introduced, sequencitally by the three commits

e94e3c2 feature2
f509e6e test4
9972849 test3

to become a single commit (with the message "feature2"), and to do the same
with the group

d7f2f97 feature1
04ea2a1 test2
1c0f590 test1

to produce a single commit (with the message "feature1")?

That would indeed produce

yyy feature2
xxx feature1
a777378 init

as you have indicated.


If yes, what you're after is called "squashing", which can be done during
so-called "rebasing".

Basically, you need to do the following:

Run

  git rebase -i a777378

to start an interactive (hence "-i") rebase of the current tip commit and
whatever follows onto a777378.

Git will pop out an editor with the so-called "rebase script".
It will read something like

pick 1c0f590 test1
pick 04ea2a1 test2
pick d7f2f97 feature1
pick 9972849 test3
pick f509e6e test4
pick e94e3c2 feature2

(Note the order reversed compared to that produced by `git log`.)

You then change the verbs of the script to read

pick 1c0f590 test1
squash 04ea2a1 test2
squash d7f2f97 feature1
pick 9972849 test3
squash f509e6e test4
squash e94e3c2 feature2

The modified script is meant to produce two commits by literally taking a base
commit for each group ("pick") and then "squash" the following two commits
into it.

You save the text and quit the editor, and the rebasing starts.
It will stop twice - offering you to provide a commit message for each of the
commits to be created. You delete all the offered text to keep only those of
"feature1" and "feature2", respectively.
After finishing each commit you run

  git rebase --continue

until it says that it has done everything.

Verify the result in the usual way (`git log`, `git show`, `gitk` etc).

See [2] for more info.

 [1]: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
 [2]: https://git-scm.com/book/en/v2/Git-Branching-Rebasing

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231117122622.pefpq3arjsorhth6%40carbon.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread 凯夏
* 36dd67b  (76345bc) - center_after_2023-11-16T19:06:01
* 76345bc  (3d730e1) - cron_2023-11-16T19:03:02+0800
* 3d730e1  (0fbd084) - center_after_2023-11-16T19:02:01
* 0fbd084  (3e8db69) - center_after_2023-11-16T19:00:01
*   3e8db69  (7efc990 a710c04) - center_before_2023-11-16T19:00:01
|\
| * a710c04  (13b3d50) - center_after_2023-11-16T19:00:01
| * 13b3d50  (69a52f8) - cron_2023-11-16T18:53:02+0800
| * 69a52f8  (d905a5f) - center_after_2023-11-16T18:52:01
| * d905a5f  (6d03043) - center_after_2023-11-16T18:50:01
| * 6d03043  (275d8cf) - cron_2023-11-16T18:49:04+0800
| * 275d8cf  (316075c) - center_after_2023-11-16T18:48:01
| * 316075c  (4537071) - center_after_2023-11-16T18:46:01
| * 4537071  (b7e44ce) - cron_2023-11-16T18:40:02+0800
| * b7e44ce  (d7a7735) - cron_2023-11-16T18:39:03+0800
| * d7a7735  (7b6c88f) - center_after_2023-11-16T18:38:01
| * 7b6c88f  (959b4e2) - cron_2023-11-16T18:38:02+0800
| * 959b4e2  (751ba83) - center_after_2023-11-16T18:36:01
| * 751ba83  (d21a29a) - center_after_2023-11-16T18:32:01
* | 7efc990  (8d9200f) - center_after_2023-11-16T18:30:01
| * d21a29a  (8d9200f) - center_after_2023-11-16T18:30:01
|/
* 8d9200f  (594b69a) - cron_2023-11-16T18:28:02+0800
* 594b69a  (22384fb) - cron_2023-11-16T18:27:03+0800
* 22384fb  (4480e1e) - center_after_2023-11-16T18:26:01
* 4480e1e  (79b4740) - cron_2023-11-16T18:26:03+0800
* 79b4740  (e9d31a5) - cron_2023-11-16T18:25:03+0800
I want to merge from 36dd67b  to 3e8db69  or to 0fbd084
from 8d9200f to 79b4740 
commits from a710c04 to d21a29a can remain unchanged.

On Friday, November 17, 2023 at 7:57:22 PM UTC+8 凯夏 wrote:

> git log --all --date-order --graph --pretty="%h %d (%p) - %s"
> * 4e702d9  (HEAD -> main) (394d1ad) - feature1
> * 394d1ad  (73da3a0) - test2
> * 73da3a0  (cdda583) - test1
> * cdda583  () - init
>
>
> On Friday, November 17, 2023 at 7:38:21 PM UTC+8 G. Sylvie Davies [
> bit-booster.com] wrote:
>
>>
>> Can you use this command for your "git log" ?
>>
>> git log --all --date-order --graph --pretty="%h %d (%p) - %s"
>>
>> That will help us understand better what you have done so far, and what 
>> you are trying to do.
>>
>> Sample output (from a different git repository):
>>
>>
>> *   5625946  (HEAD -> master) (0a943a2 5bb1eef) - merge
>> |\  
>> | * 5bb1eef  (origin/basic_branching, basic_branching) (46492ce) - cow moo
>> | * 46492ce  (d6edcbf) - cow say moo
>> * | 0a943a2  (tag: signed_tag, tag: retagged_signed_tag, origin/master, 
>> origin/HEAD) (e0a3f6d) - Copy C.zip as D.zip
>> * | e0a3f6d  (2d8897c) - Add binary file C.zip
>> * | 2d8897c  (9c05f43) - Rename A.zip to B.zip
>> * | 9c05f43  (6053a1e) - Add binary file A.zip
>> * | 6053a1e  (origin/branch_mod_merge) (042fb0c) - modification on 
>> branch_mod_merge
>> * | 042fb0c  (8fb8538) - branch, mod and merge scenario
>> | * d6edcbf  (8fb8538) - a modification on branch basic_branching
>> |/  
>> * 8fb8538  (53979b3) - basic branching scenario
>> * 53979b3  (ed69be6) - moved mv_dir to moved_dir
>>
>>
>>
>> On Friday, November 17, 2023 at 2:09:11 AM UTC-8 walk...@gmail.com wrote:
>>
>>> This is result of running git log.
>>> My bad, the result i want is git log output like this:
>>> yyy feature2
>>> xxx feature1
>>> a777378 init
>>> x and y means this can change.
>>> i just want to delete some unneeded commit to save space. 
>>> because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
>>> and feature1 maybe change 125 to 126, after merge,feature1 can just chang 
>>> 123 to 126.
>>> On Friday, November 17, 2023 at 6:02:41 PM UTC+8 Konstantin Khomoutov 
>>> wrote:
>>>
 On Fri, Nov 17, 2023 at 01:00:46PM +0300, Konstantin Khomoutov wrote: 

 >> how can i merge test1 test2 into feature1? 
 >> e94e3c2 feature2 
 >> f509e6e test4 
 >> 9972849 test3 
 >> d7f2f97 feature1 
 >> 04ea2a1 test2 
 >> 1c0f590 test1 
 >> a777378 init 
 > 
 > Before we continue... Is this just a list of assorted commits with no 
 inherent 
 > ordering between them or is there a result of running `git log`? 
 > 
 > If it's the latter, feature2 appears to contain both test1 and test2 
 already. 

 Oops, I wanted to say that feature1 appears to contain both test1 and 
 test2, 
 of course. 

 But since feature2 contains feature1, it transitively also contains 
 test1 and 
 test2, for what it worth. 



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d23e9c5d-fdf0-4d08-a9d5-7611fa872a7cn%40googlegroups.com.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread 凯夏
git log --all --date-order --graph --pretty="%h %d (%p) - %s"
* 4e702d9  (HEAD -> main) (394d1ad) - feature1
* 394d1ad  (73da3a0) - test2
* 73da3a0  (cdda583) - test1
* cdda583  () - init


On Friday, November 17, 2023 at 7:38:21 PM UTC+8 G. Sylvie Davies 
[bit-booster.com] wrote:

>
> Can you use this command for your "git log" ?
>
> git log --all --date-order --graph --pretty="%h %d (%p) - %s"
>
> That will help us understand better what you have done so far, and what 
> you are trying to do.
>
> Sample output (from a different git repository):
>
>
> *   5625946  (HEAD -> master) (0a943a2 5bb1eef) - merge
> |\  
> | * 5bb1eef  (origin/basic_branching, basic_branching) (46492ce) - cow moo
> | * 46492ce  (d6edcbf) - cow say moo
> * | 0a943a2  (tag: signed_tag, tag: retagged_signed_tag, origin/master, 
> origin/HEAD) (e0a3f6d) - Copy C.zip as D.zip
> * | e0a3f6d  (2d8897c) - Add binary file C.zip
> * | 2d8897c  (9c05f43) - Rename A.zip to B.zip
> * | 9c05f43  (6053a1e) - Add binary file A.zip
> * | 6053a1e  (origin/branch_mod_merge) (042fb0c) - modification on 
> branch_mod_merge
> * | 042fb0c  (8fb8538) - branch, mod and merge scenario
> | * d6edcbf  (8fb8538) - a modification on branch basic_branching
> |/  
> * 8fb8538  (53979b3) - basic branching scenario
> * 53979b3  (ed69be6) - moved mv_dir to moved_dir
>
>
>
> On Friday, November 17, 2023 at 2:09:11 AM UTC-8 walk...@gmail.com wrote:
>
>> This is result of running git log.
>> My bad, the result i want is git log output like this:
>> yyy feature2
>> xxx feature1
>> a777378 init
>> x and y means this can change.
>> i just want to delete some unneeded commit to save space. 
>> because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
>> and feature1 maybe change 125 to 126, after merge,feature1 can just chang 
>> 123 to 126.
>> On Friday, November 17, 2023 at 6:02:41 PM UTC+8 Konstantin Khomoutov 
>> wrote:
>>
>>> On Fri, Nov 17, 2023 at 01:00:46PM +0300, Konstantin Khomoutov wrote: 
>>>
>>> >> how can i merge test1 test2 into feature1? 
>>> >> e94e3c2 feature2 
>>> >> f509e6e test4 
>>> >> 9972849 test3 
>>> >> d7f2f97 feature1 
>>> >> 04ea2a1 test2 
>>> >> 1c0f590 test1 
>>> >> a777378 init 
>>> > 
>>> > Before we continue... Is this just a list of assorted commits with no 
>>> inherent 
>>> > ordering between them or is there a result of running `git log`? 
>>> > 
>>> > If it's the latter, feature2 appears to contain both test1 and test2 
>>> already. 
>>>
>>> Oops, I wanted to say that feature1 appears to contain both test1 and 
>>> test2, 
>>> of course. 
>>>
>>> But since feature2 contains feature1, it transitively also contains 
>>> test1 and 
>>> test2, for what it worth. 
>>>
>>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/2dc7bd5f-3cd3-495c-94f4-fd418ac1ffean%40googlegroups.com.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread G. Sylvie Davies [bit-booster.com]

Can you use this command for your "git log" ?

git log --all --date-order --graph --pretty="%h %d (%p) - %s"

That will help us understand better what you have done so far, and what you 
are trying to do.

Sample output (from a different git repository):


*   5625946  (HEAD -> master) (0a943a2 5bb1eef) - merge
|\  
| * 5bb1eef  (origin/basic_branching, basic_branching) (46492ce) - cow moo
| * 46492ce  (d6edcbf) - cow say moo
* | 0a943a2  (tag: signed_tag, tag: retagged_signed_tag, origin/master, 
origin/HEAD) (e0a3f6d) - Copy C.zip as D.zip
* | e0a3f6d  (2d8897c) - Add binary file C.zip
* | 2d8897c  (9c05f43) - Rename A.zip to B.zip
* | 9c05f43  (6053a1e) - Add binary file A.zip
* | 6053a1e  (origin/branch_mod_merge) (042fb0c) - modification on 
branch_mod_merge
* | 042fb0c  (8fb8538) - branch, mod and merge scenario
| * d6edcbf  (8fb8538) - a modification on branch basic_branching
|/  
* 8fb8538  (53979b3) - basic branching scenario
* 53979b3  (ed69be6) - moved mv_dir to moved_dir



On Friday, November 17, 2023 at 2:09:11 AM UTC-8 walk...@gmail.com wrote:

> This is result of running git log.
> My bad, the result i want is git log output like this:
> yyy feature2
> xxx feature1
> a777378 init
> x and y means this can change.
> i just want to delete some unneeded commit to save space. 
> because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
> and feature1 maybe change 125 to 126, after merge,feature1 can just chang 
> 123 to 126.
> On Friday, November 17, 2023 at 6:02:41 PM UTC+8 Konstantin Khomoutov 
> wrote:
>
>> On Fri, Nov 17, 2023 at 01:00:46PM +0300, Konstantin Khomoutov wrote: 
>>
>> >> how can i merge test1 test2 into feature1? 
>> >> e94e3c2 feature2 
>> >> f509e6e test4 
>> >> 9972849 test3 
>> >> d7f2f97 feature1 
>> >> 04ea2a1 test2 
>> >> 1c0f590 test1 
>> >> a777378 init 
>> > 
>> > Before we continue... Is this just a list of assorted commits with no 
>> inherent 
>> > ordering between them or is there a result of running `git log`? 
>> > 
>> > If it's the latter, feature2 appears to contain both test1 and test2 
>> already. 
>>
>> Oops, I wanted to say that feature1 appears to contain both test1 and 
>> test2, 
>> of course. 
>>
>> But since feature2 contains feature1, it transitively also contains test1 
>> and 
>> test2, for what it worth. 
>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/a1778830-a39b-4ee4-a655-58ab895111a0n%40googlegroups.com.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread 凯夏
This is result of running git log.
My bad, the result i want is git log output like this:
yyy feature2
xxx feature1
a777378 init
x and y means this can change.
i just want to delete some unneeded commit to save space. 
because test1 maybe change 123 to 124 and test2 maybe change 124 to 125, 
and feature1 maybe change 125 to 126, after merge,feature1 can just chang 
123 to 126.
On Friday, November 17, 2023 at 6:02:41 PM UTC+8 Konstantin Khomoutov wrote:

> On Fri, Nov 17, 2023 at 01:00:46PM +0300, Konstantin Khomoutov wrote:
>
> >> how can i merge test1 test2 into feature1?
> >> e94e3c2 feature2
> >> f509e6e test4
> >> 9972849 test3
> >> d7f2f97 feature1
> >> 04ea2a1 test2
> >> 1c0f590 test1
> >> a777378 init
> > 
> > Before we continue... Is this just a list of assorted commits with no 
> inherent
> > ordering between them or is there a result of running `git log`?
> > 
> > If it's the latter, feature2 appears to contain both test1 and test2 
> already.
>
> Oops, I wanted to say that feature1 appears to contain both test1 and 
> test2,
> of course.
>
> But since feature2 contains feature1, it transitively also contains test1 
> and
> test2, for what it worth.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/74588879-2fb2-4c3c-b274-114960d42c16n%40googlegroups.com.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread Konstantin Khomoutov
On Fri, Nov 17, 2023 at 01:00:46PM +0300, Konstantin Khomoutov wrote:

>> how can i merge test1 test2 into feature1?
>> e94e3c2 feature2
>> f509e6e test4
>> 9972849 test3
>> d7f2f97 feature1
>> 04ea2a1 test2
>> 1c0f590 test1
>> a777378 init
> 
> Before we continue... Is this just a list of assorted commits with no inherent
> ordering between them or is there a result of running `git log`?
> 
> If it's the latter, feature2 appears to contain both test1 and test2 already.

Oops, I wanted to say that feature1 appears to contain both test1 and test2,
of course.

But since feature2 contains feature1, it transitively also contains test1 and
test2, for what it worth.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231117100234.d5dowyku3cfxlapo%40carbon.


Re: [git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread Konstantin Khomoutov
On Fri, Nov 17, 2023 at 12:41:37AM -0800, 凯夏 wrote:

> how can i merge test1 test2 into feature1?
> e94e3c2 feature2
> f509e6e test4
> 9972849 test3
> d7f2f97 feature1
> 04ea2a1 test2
> 1c0f590 test1
> a777378 init

Before we continue... Is this just a list of assorted commits with no inherent
ordering between them or is there a result of running `git log`?

If it's the latter, feature2 appears to contain both test1 and test2 already.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231117100044.3ypoplgpeezp5cwh%40carbon.


[git-users] how can i merge the specified commits, not the last N commits?

2023-11-17 Thread 凯夏
how can i merge test1 test2 into feature1?
e94e3c2 feature2
f509e6e test4
9972849 test3
d7f2f97 feature1
04ea2a1 test2
1c0f590 test1
a777378 init

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/4c08a8fa-06bd-4dfb-8eb8-d275e82e511fn%40googlegroups.com.


Re: [gitlab forks (keys)] (was: [git-users] how to exclude certain directories from push)

2023-10-26 Thread Konstantin Khomoutov
On Thu, Oct 26, 2023 at 06:20:07PM +0200, Uwe Brauer wrote:

>>> If after one week I  push again to my gitlab repository 
>>> (pushing the new subdirectory), 
>>> 
>>> 1. how will the students notice that in their forks?
> 
>> Automatically? They won't in the sense they won't receive any automatically
>> generated e-mail message or something like this.
> 
> I just run an experiment on gitlab.
> 
> When I push a new commit to my repository, the other user, who forked is
> then informed that he should update, that is cool. 

You mean, GitLab sends them a mail message, right?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231026171118.hvazmw3eeokmz7nz%40carbon.


[gitlab forks (keys)] (was: [git-users] how to exclude certain directories from push)

2023-10-26 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

> On Wed, Oct 25, 2023 at 02:15:43PM +0200, Uwe Brauer wrote:

>> If after one week I  push again to my gitlab repository 
>> (pushing the new subdirectory), 
>> 
>> 1. how will the students notice that in their forks?

> Automatically? They won't in the sense they won't receive any automatically
> generated e-mail message or something like this.

I just run an experiment on gitlab.

When I push a new commit to my repository, the other user, who forked is
then informed that he should update, that is cool. 

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Hamas terroristic attack on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87lebpfj9k.fsf_-_%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to exclude certain directories from push

2023-10-26 Thread Uwe Brauer

> On Wed, Oct 25, 2023 at 02:15:43PM +0200, Uwe Brauer wrote:
> [... I cut one piece from here to reply to it separately - see below ...]

> Well, the expanded explanation is exactly how I imagined it after reading your
> initial mail, so I basically have nothing to add except minor clarifications.


[Snip]...


> Given that, there are two ways to make the changes available, and they are
> basically the same:

>  - Just keep them outside of Git's control - that is, do not commit them
>until there's time for them to get shared.

>  - Commit them, but do that on a separate branch. Whet it's time, you merge
>that branch into the one used to share these changes, then push.

I am an idiot (or more politely still have  mercurial in mind, and
forget that mercurial and git are in a lot of things orthogonal. In
mercurial if you run 
hg push, 

you push all branches (if you want to push only
the «current» branch you work on, you must specify this by adding an
option, in git it is the other way around, 
git push, 

pushes only the actual branch if you want to push all branches, you need
to add the relevant option)

Ok, thanks for reminding me. Problem solved.



-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Hamas terroristic attack on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87fs1xhq0d.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to exclude certain directories from push

2023-10-25 Thread Konstantin Khomoutov
On Wed, Oct 25, 2023 at 02:15:43PM +0200, Uwe Brauer wrote:

>> Do you mean the repository has to begin with zero or, say, one such
>> subdirectory, and others have to appear there picemeal - as you add them?
> 
> Right, and I think I explained my workflow poorly. So let me start
> again.
> 
> Last year I had for one sheet, one directory (actually the directory
> contained a PDF, a .m and a .mlx template file: BTW bad idea to use mlx,
> it is zipped xml and git and other VC cannot really deal with them: diff
> and blame do not really work).
> 
> So when I was finished preparing one directory, 
> - I pushed it to gitlab,
> - shared it with the students,
> - they had to fork it  and then share their forks with me.
> - There was pushing, pulling, merging, editing conflicts etc, but more
>   or a less it was a smooth experience.
> 
> However this year I will have 50 students and 8 sheets, which would
> result in 400 repository, clearly an overkill.
> 
> So I thought to work with only  one directory/repository that contains 8
> subdirectories. 
> 
> Now I don't want to push all 8 subdirectories in one go, because the
> students should work sequentially. So I see two options
> 
> 1. I will have the sheets in my repository, and when it is the
>moment, I copy the directory to the one I share with my students
>add the files commit and then push to gitlab
> 
> 2. Instead of copying I have already all files in the corresponding
>subdirectories, but they are not pushed because I have configured
>.gitignore that way. The problem is then: if I change something in
>these directories these changes are not tracked; I could try git
>init in each subdirectory, but it seems another maybe unnecessary
>complication.
> 
> In any case one thing is not clear to me, and it maybe concerns more
> gitlab than git itself:
[... I cut one piece from here to reply to it separately - see below ...]
> Did I explain this now better?

Well, the expanded explanation is exactly how I imagined it after reading your
initial mail, so I basically have nothing to add except minor clarifications.

The first and major thing worth reiterating is that when Git repositories
communicate - when you do push (send, share) or fetch (receive) - they always
exchange commits (I would like to write "complete commits" but there's no such
things as incomplete commits). A commit refers to (points at) its parent
commit (or commits) and exactly one "tree" which represents the contents of
the top-level directory of the repository. That tree refers to blobs
representing files in it and other trees - representing subdirectories (and so
on, and so forth - recursively). That way, any commit always is a complete
snapshot of the whole project. And as such you cannot push (share) only some
parts of it: Git sends and receives whole, complete commits.

So, if you'd like to "keep aside" certain changes for certain time, you cannot
record them in a commit and then not send them when you send (share) that
commit.

Given that, there are two ways to make the changes available, and they are
basically the same:

 - Just keep them outside of Git's control - that is, do not commit them
   until there's time for them to get shared.

 - Commit them, but do that on a separate branch. Whet it's time, you merge
   that branch into the one used to share these changes, then push.

   This one won't work with a single separate branch if you have more than
   a single directory to make available in turn. I mean, if you have, say,
   10 such directories, and would like to put them under the Git's control
   all at once - if only for "backup" purposes, - but publish one after
   another, you would need 10 separate branches - one per separate directory,
   which you would then merge one after another into the main branch.

> If after one week I  push again to my gitlab repository 
> (pushing the new subdirectory), 
> 
> 1. how will the students notice that in their forks?

Automatically? They won't in the sense they won't receive any automatically
generated e-mail message or something like this.

Manually - they will: if one performs `git fetch` and then runs `git status`,
the latter will tell something like "Your branch is N commits behing the
branch it tracks".

> 2. Do they have to pull or, horror, make another fork?

They will have to pull - that is, fetch then merge (that's what pull does),
and that's exactly what I proposed.

In other words, to me, this model does not differ from the most usual
application of Git where Joe, Jill and Mary work on a single project: when Joe
commits, Jill and Mary usually want to make those changes available in their
respective local repositories, so they fetch and merge (pull) or fetch then
rebase (but let's not touch this one).

-- 
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 

Re: [git-users] how to exclude certain directories from push

2023-10-25 Thread Uwe Brauer

> On Tue, Oct 24, 2023 at 06:38:50PM +0200, Uwe Brauer wrote:
> [...]

> Do you mean the repository has to begin with zero or, say, one such
> subdirectory, and others have to appear there picemeal - as you add them?

Right, and I think I explained my workflow poorly. So let me start
again.

Last year I had for one sheet, one directory (actually the directory
contained a PDF, a .m and a .mlx template file: BTW bad idea to use mlx,
it is zipped xml and git and other VC cannot really deal with them: diff
and blame do not really work).

So when I was finished preparing one directory, 
- I pushed it to gitlab,
- shared it with the students,
- they had to fork it  and then share their forks with me.
- There was pushing, pulling, merging, editing conflicts etc, but more
  or a less it was a smooth experience.

However this year I will have 50 students and 8 sheets, which would
result in 400 repository, clearly an overkill.

So I thought to work with only  one directory/repository that contains 8
subdirectories. 

Now I don't want to push all 8 subdirectories in one go, because the
students should work sequentially. So I see two options

1. I will have the sheets in my repository, and when it is the
   moment, I copy the directory to the one I share with my students
   add the files commit and then push to gitlab

2. Instead of copying I have already all files in the corresponding
   subdirectories, but they are not pushed because I have configured
   .gitignore that way. The problem is then: if I change something in
   these directories these changes are not tracked; I could try git
   init in each subdirectory, but it seems another maybe unnecessary
   complication.

In any case one thing is not clear to me, and it maybe concerns more
gitlab than git itself:

If after one week I  push again to my gitlab repository 
(pushing the new subdirectory), 

1. how will the students notice that in their forks?
2. Do they have to pull or, horror, make another fork?

Did I explain this now better?

Thanks

Uwe Brauer 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/875y2uj3tc.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to exclude certain directories from push

2023-10-25 Thread Konstantin Khomoutov
On Tue, Oct 24, 2023 at 06:38:50PM +0200, Uwe Brauer wrote:

[...]
> Here is the situation. I want to create one single repository that
> contains various (subdirectories). Each subdirectory contains several
> files corresponding to certain sheets my students (numerical analysis)
> have to solve. 
> 
> The student  should clone the repository and then create their corresponding
> solutions in the relevant directories then push, share with me the
> repository etc etc.
> 
> However I don't want to push all the directories at once, but during the
> course.

Do you mean the repository has to begin with zero or, say, one such
subdirectory, and others have to appear there picemeal - as you add them?

> My first thought was to use .gitignore and just exclude these
> directories.
> 
> The problem is I might change some files and want to track these
> changes.
> 
> (In mercurial I most likely would use phases, (secret and draft)
> although I am not sure that would really work)
> 
> An other option would be to run git init in these directories (but not
> include them as sub-repositories), and hope that git would ignore
> directories that are themselves under git control.
> 
> But then I am not sure how I could merge it later to the main
> repository.

Your initial premise is wrong.
In Git (and, I think, any DVCS system) commits are created in individual
repositories and then possibly shared with other repositories - by pushing and
fetching. (Always remember that even though you in your setup have a "central
server" which is a rendez-vouz point to coordinate work on some project,
still, it's just another Git repository, nothing really special.)
A commit is always a snapshot of the whole project managed by a repository so,
by definition, you cannot record such a snapshot and then share only some
parts of it (but not others).

I honestly have no idea how Mercurial manages to do something like that.

As to possible solutions, I think _conceptually_ the simplest one is merges.
I mean, the setup you describe is the very basic workflow routinely used by
some teams: your changes - adding more directories or more files to existing
directories - is merely changes done in some line of development. So, it could
be implemented like that: suppose you have just a single branch; let it be
"master".

 1) You start with a single directory, add it, commit then push.

 2) Your students clone the repository and end up with their local clones
with their local branch "master" (tracking the same-named branch in the
remote repository named "origin).

 3) A student adds their own files, commits then pushes [*].

 4) After some time you add more directories, commit then push [**].

 5) Your students then do `git pull` to fetch your changes and merge
them into their local "master".

 6) GOTO 3.

"The catch" here is bound to happen at points marked by asterisks:

 - When a student tries to push while you or some other student has managed to
   push their own work since our student has last fetched (or pulled, which is
   the same for these matters), the push will fail. The student will then need
   to `git pull` and retry their push, which must succeed - unless in the
   meantime someone else has again managed to sneak in their changes.

 - Your own push may fail by the same reason, and the course of action is
   the same: you `git pull` and retry.

The described workflow is often frowned upon as it creates what is called
"diamond history" (because the merges "go in both directions"), but it works.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20231025084124.ttcwrwljet4z4pho%40carbon.


[git-users] how to exclude certain directories from push

2023-10-24 Thread Uwe Brauer

Hi

Here is the situation. I want to create one single repository that
contains various (subdirectories). Each subdirectory contains several
files corresponding to certain sheets my students (numerical analysis)
have to solve. 

The student  should clone the repository and then create their corresponding
solutions in the relevant directories then push, share with me the
repository etc etc.

However I don't want to push all the directories at once, but during the
course.

My first thought was to use .gitignore and just exclude these
directories.

The problem is I might change some files and want to track these
changes.

(In mercurial I most likely would use phases, (secret and draft)
although I am not sure that would really work)

An other option would be to run git init in these directories (but not
include them as sub-repositories), and hope that git would ignore
directories that are themselves under git control.

But then I am not sure how I could merge it later to the main
repository.

Any suggestions would be very welcome

Regards

Uwe Brauer 

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Hamas bestialic terroristic attack on Israel, especially the 
despicable pogroms.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of Ukraine.
I support the EU membership of Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87jzrcnffp.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] How update submodules temporary local?

2023-08-10 Thread Konstantin Khomoutov
On Wed, Aug 09, 2023 at 11:21:49AM -0700, Andy wrote:

> I have application and library. Library is a submodule 'mounted' to 
> subdirectory of application.
> I am heavily modifying library. I am using application to test library. 
> Each commit I have to push to Github (or other) and update the submodule 
> for the application.
> If is possible (temporary) to use local submodule with many commits?, even 
> I want use submodule branches. I only want to push commits to remote 
> submodule once in a while.
[...]

Isn't it already covered in The Book? [1].

 1. https://git-scm.com/book/en/v2/Git-Tools-Submodules#_working_on_a_submodule

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20230810122240.t6hsjktu4y5wfio3%40carbon.


[git-users] How update submodules temporary local?

2023-08-09 Thread Andy
Hi, I am new in this Google group.

I have application and library. Library is a submodule 'mounted' to 
subdirectory of application.
I am heavily modifying library. I am using application to test library. 
Each commit I have to push to Github (or other) and update the submodule 
for the application.
If is possible (temporary) to use local submodule with many commits?, even 
I want use submodule branches. I only want to push commits to remote 
submodule once in a while.

I think about:
- make copy of application. Library git repository with remote will be 
inside application directory, which will without git or git but without 
remote and submodules. (how about .git inside directory with another .git?) 
Then I can change library, often commit, sometimes push. Is possible cherry 
pick to another repository?

But, just came to my mind:
application will have two branches: one with remote submodules, second with 
local submodules (how do it?) or library .git inside application directory.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/e3d5b655-251b-4315-be42-69761f239ba1n%40googlegroups.com.


Re: [git-users] How to print log tree

2023-06-11 Thread Uwe Brauer
>>> "ZH" == Zhanbang He  writes:

> Thanks, it works for me based on your  command.
> This is my  command  `git log  --graph --color=always --all --decorate
> --oneline --since="2023-6-6" | git name-rev --annotate-stdin`.

> One drawback of my command is that it does not show the time of commit.


Very strange, here is what the output for the auctex repository
 git://git.savannah.gnu.org/auctex.git (

Using 
git log --graph --all   



* commit 1a2060af30258bab872d2f3a607f863a7be9e6b5 (HEAD -> master, 
origin/master, origin/HEAD)
| Author: Arash Esbati 
| Date:   Sat Mar 25 23:14:35 2023 +0100
|
| * style/pdfpages.el ("pdfpages"): Replace `TeX-arg-eval'.
|
* commit 2a65fac9b17a81fdbcad1e71ef9537771809354b 
(auctex-hg-git-remote/branches/master)
| Author: Arash Esbati 
| Date:   Fri Mar 17 10:38:54 2023 +0100
|
| Return correct completion candidates in math-mode
|
| * latex.el (LaTeX-common-initialization): Make sure that from the
| second elements inside `LaTeX-math-list' and `LaTeX-math-default',
| only the strings are used for `TeX-complete-list'.  The second
| element can also be a function which is not correct for completion
| purposes.  (bug#62220)
|


But I am on Linux, not windows

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87mt167b84.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] How to print log tree

2023-06-11 Thread Zhanbang He
Thanks, it works for me based on your  command.

This is my  command  `git log  --graph --color=always --all --decorate
--oneline --since="2023-6-6" | git name-rev --annotate-stdin`.

One drawback of my command is that it does not show the time of commit.

On Sun, Jun 11, 2023 at 2:18 PM Zhanbang He  wrote:

>
>
> On Sun, Jun 11, 2023 at 2:03 PM Uwe Brauer  wrote:
>
>>
>> > On Thu, Jun 8, 2023 at 12:56 AM Konstantin Khomoutov 
>> > wrote:
>>
>> > no good, it only shows simple-line commits.
>>
>>
>> Try one of these
>>
>>
>> git log   --graph --color=always --all --decorate --pretty | git name-rev
>> --annotate-stdin | less -R
>>
> not found command 'less', because My OS is Windows 10 Pro.
>
>>
>> git log   --graph --color=always --branches  --remotes --decorate
>> --pretty | git name-rev --annotate-stdin | less -R
>>
>> git log   --graph --color=always --branches  --remotes --since=2years
>> --decorate --pretty | git name-rev --annotate-stdin | less -R
>>
>>
>> --
>> Warning: Content may be disturbing to some audiences
>> I strongly condemn Putin's war of aggression against the Ukraine.
>> I support to deliver weapons to Ukraine's military.
>> I support the NATO membership of the Ukraine.
>> I support the EU membership of the Ukraine.
>>
>> https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CALZOGtT8kHtUBtBFOrUGRX%2BQZEy2X7tUhx4yEjggXyFMhqkQgw%40mail.gmail.com.


Re: [git-users] How to print log tree

2023-06-11 Thread Zhanbang He
On Sun, Jun 11, 2023 at 2:03 PM Uwe Brauer  wrote:

>
> > On Thu, Jun 8, 2023 at 12:56 AM Konstantin Khomoutov 
> > wrote:
>
> > no good, it only shows simple-line commits.
>
>
> Try one of these
>
>
> git log   --graph --color=always --all --decorate --pretty | git name-rev
> --annotate-stdin | less -R
>
not found command 'less', because My OS is Windows 10 Pro.

>
> git log   --graph --color=always --branches  --remotes --decorate --pretty
> | git name-rev --annotate-stdin | less -R
>
> git log   --graph --color=always --branches  --remotes --since=2years
> --decorate --pretty | git name-rev --annotate-stdin | less -R
>
>
> --
> Warning: Content may be disturbing to some audiences
> I strongly condemn Putin's war of aggression against the Ukraine.
> I support to deliver weapons to Ukraine's military.
> I support the NATO membership of the Ukraine.
> I support the EU membership of the Ukraine.
>
> https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CALZOGtSmxpZFgrDqAzRS4EJhHvCMnfrhv4aSvth8DdOAQjabRA%40mail.gmail.com.


Re: [git-users] How to print log tree

2023-06-11 Thread Uwe Brauer

> On Thu, Jun 8, 2023 at 12:56 AM Konstantin Khomoutov 
> wrote:

> no good, it only shows simple-line commits.


Try one of these 


git log   --graph --color=always --all --decorate --pretty | git name-rev 
--annotate-stdin | less -R

git log   --graph --color=always --branches  --remotes --decorate --pretty | 
git name-rev --annotate-stdin | less -R

git log   --graph --color=always --branches  --remotes --since=2years 
--decorate --pretty | git name-rev --annotate-stdin | less -R


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the NATO membership of the Ukraine.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87352y8rjc.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] How to print log tree

2023-06-10 Thread Zhanbang He
On Thu, Jun 8, 2023 at 12:56 AM Konstantin Khomoutov 
wrote:

> On Tue, Jun 06, 2023 at 05:52:13PM -0700, Zhanbang He wrote:
>
> > when run `git log`, it only show many commits. But can not show
> > commits with  branch-tree.
> > So How  can I print log tree?
>
> I fail to quite parse the "can not show commits with branch-tree" part,
> but have you tried
>
>   git log --graph --oneline --decorate
>
> and may be even
>
>   git log --graph --oneline --decorate --all
>
no good, it only shows simple-line commits.

>
> (which is OK on small repositories)?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/20230607165644.tk2e4fin2h2mwl7p%40carbon
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CALZOGtRqgi3%3Dk9aaN5FshnbCPy1CyYrq-boB%3DJtCc%3DrcWwi68Q%40mail.gmail.com.


Re: [git-users] How to print log tree

2023-06-07 Thread Konstantin Khomoutov
On Tue, Jun 06, 2023 at 05:52:13PM -0700, Zhanbang He wrote:

> when run `git log`, it only show many commits. But can not show  
> commits with  branch-tree.
> So How  can I print log tree?

I fail to quite parse the "can not show commits with branch-tree" part,
but have you tried

  git log --graph --oneline --decorate

and may be even

  git log --graph --oneline --decorate --all

(which is OK on small repositories)?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20230607165644.tk2e4fin2h2mwl7p%40carbon.


[git-users] How to print log tree

2023-06-06 Thread Zhanbang He
Hi all
when run `git log`, it only show many commits. But can not show  
commits with  branch-tree.
So How  can I print log tree?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/ee807728-8bcf-4732-8516-cf816d6d09fcn%40googlegroups.com.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-04 Thread Konstantin Khomoutov
On Thu, May 04, 2023 at 11:35:32AM -0400, Hugo Villeneuve wrote:

[...]
> > > > > For this, I do not want to use the global entries like smtpUser,
> > > > > tocmd, etc. Unfortunately, these entries are set to the default value
> > > > > in /etc/config.
> > > > 
> > > > Yes, but you could explicitly set them to empty strings in your
> > > > project's .git/config.
[...]
> > > no, I tried it and it doesn't work.
> > > 
> > > Setting an entry to an empty string is not the same as having this entry
> > > "not defined" for some applications.
> > > 
> > > For example, if you look at the git sendemail source code, you will see 
> > > take
> > > a different action is taken depending if the "tocmd" entry is undefined or
> > > is set to an empty string.
[...]
> > The git-send-email manual page [1] mentions the possibility of having named
> > "identities" for sending mail - the sendemail.identity configuration 
> > variable
> > and the "namespaced" settings «sendemail..*».
> > 
> > Wouldn't it be possible to (ab)use this mechainsm in the following way:
[...]
> yes, it works, but it means that I must rename the default identity
> [sendemail] to something like [sendemail.default] like you suggested.
> 
> But doing so means that for every project that needs to use the default
> identity, I must now pass the command line option "--identity default" when
> using git sendemail, which I find inconvenient and also incompatible with
> some automated scripts I have developped to call git sendemail.
[...]

OK, looks like this issue might be worth bringing up on the main Git list
then. Maybe Git could actually implement some value - or type of value -
meaning "explicitly undefined", or something like this.

Please consult [2] before posting there if you're not familiar with the
caveats of doing so ;-)

 2. 
https://gist.github.com/tfnico/4441562#writing-an-email-to-the-developers-list

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20230504161329.76f2exejmii3xkf7%40carbon.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-04 Thread Hugo Villeneuve

On 5/4/23 10:59, Konstantin Khomoutov wrote:

On Wed, May 03, 2023 at 03:53:57PM -0400, Hugo Villeneuve wrote:

[...]

I have a global git settings in /etc/git/config that I use for most of
my projects:

[sendemail]
  smtpUser = my-username
  smtpServer = mail.my-server.com
  smtpServerPort = 2525
  tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nol"
  cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nom"

However, for a particular project, I must use a different sendemail
configuration. I have added this to my .git/config file in this
project:

[sendemail]
  smtpServer = alternate-mail-server.com

For this, I do not want to use the global entries like smtpUser,
tocmd, etc. Unfortunately, these entries are set to the default value
in /etc/config.


Yes, but you could explicitly set them to empty strings in your
project's .git/config.


Hi Tassilo,
no, I tried it and it doesn't work.

Setting an entry to an empty string is not the same as having this entry
"not defined" for some applications.

For example, if you look at the git sendemail source code, you will see take
a different action is taken depending if the "tocmd" entry is undefined or
is set to an empty string.

[...]

The git-send-email manual page [1] mentions the possibility of having named
"identities" for sending mail - the sendemail.identity configuration variable
and the "namespaced" settings «sendemail..*».

Wouldn't it be possible to (ab)use this mechainsm in the following way:

  * In the global configuration, have the default settings in a named
identity, as well as having the sendemail.identity set to the name of that
identity - something like

  sendemail.default.smtpUser = my-username
  ...
  sendemail.identity = default

  * The local configuration might possibly be just left as is or, if that does
not work, you could define it in a way similar to the global one, but
involving a differently-named identity - such as "local".

Please note that I do not even have git-send-email installed, so all of the
above is plain guessing.

  1. https://git-scm.com/docs/git-send-email


Hi,
yes, it works, but it means that I must rename the default identity 
[sendemail] to something like [sendemail.default] like you suggested.


But doing so means that for every project that needs to use the default 
identity, I must now pass the command line option "--identity default" 
when using git sendemail, which I find inconvenient and also 
incompatible with some automated scripts I have developped to call git 
sendemail.


Thank you for your suggestion though, worth knowing anyway.

Hugo.


--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/fdc48311-b7a0-c0e2-63f3-5be4416e4c48%40gmail.com.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-04 Thread Konstantin Khomoutov
On Wed, May 03, 2023 at 03:53:57PM -0400, Hugo Villeneuve wrote:

[...]
> > > I have a global git settings in /etc/git/config that I use for most of
> > > my projects:
> > > 
> > > [sendemail]
> > >  smtpUser = my-username
> > >  smtpServer = mail.my-server.com
> > >  smtpServerPort = 2525
> > >  tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
> > > --norolestats --nol"
> > >  cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
> > > --norolestats --nom"
> > > 
> > > However, for a particular project, I must use a different sendemail
> > > configuration. I have added this to my .git/config file in this
> > > project:
> > > 
> > > [sendemail]
> > >  smtpServer = alternate-mail-server.com
> > > 
> > > For this, I do not want to use the global entries like smtpUser,
> > > tocmd, etc. Unfortunately, these entries are set to the default value
> > > in /etc/config.
> > 
> > Yes, but you could explicitly set them to empty strings in your
> > project's .git/config.
> 
> Hi Tassilo,
> no, I tried it and it doesn't work.
> 
> Setting an entry to an empty string is not the same as having this entry
> "not defined" for some applications.
> 
> For example, if you look at the git sendemail source code, you will see take
> a different action is taken depending if the "tocmd" entry is undefined or
> is set to an empty string.
[...]

The git-send-email manual page [1] mentions the possibility of having named
"identities" for sending mail - the sendemail.identity configuration variable
and the "namespaced" settings «sendemail..*».

Wouldn't it be possible to (ab)use this mechainsm in the following way:

 * In the global configuration, have the default settings in a named
   identity, as well as having the sendemail.identity set to the name of that
   identity - something like

 sendemail.default.smtpUser = my-username
 ...
 sendemail.identity = default

 * The local configuration might possibly be just left as is or, if that does
   not work, you could define it in a way similar to the global one, but
   involving a differently-named identity - such as "local".

Please note that I do not even have git-send-email installed, so all of the
above is plain guessing.

 1. https://git-scm.com/docs/git-send-email

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20230504145917.66tr7sdmv2fgj237%40carbon.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-03 Thread Hugo Villeneuve

On Wed, 3 May 2023 15:53:57 -0400
Hugo Villeneuve  wrote:


On 5/3/23 15:15, Tassilo Horn wrote:
> Hugo Villeneuve  writes:
> 
> Hi Hugo,
> 
>> I have a global git settings in /etc/git/config that I use for most of

>> my projects:
>>
>> [sendemail]
>>  smtpUser = my-username
>>  smtpServer = mail.my-server.com
>>  smtpServerPort = 2525
>>  tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
>> --norolestats --nol"
>>  cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
>> --norolestats --nom"
>>
>> However, for a particular project, I must use a different sendemail
>> configuration. I have added this to my .git/config file in this
>> project:
>>
>> [sendemail]
>>  smtpServer = alternate-mail-server.com
>>
>> For this, I do not want to use the global entries like smtpUser,
>> tocmd, etc. Unfortunately, these entries are set to the default value
>> in /etc/config.
> 
> Yes, but you could explicitly set them to empty strings in your

> project's .git/config.

Hi Tassilo,
no, I tried it and it doesn't work.

Setting an entry to an empty string is not the same as having this entry 
"not defined" for some applications.


For example, if you look at the git sendemail source code, you will see 
take a different action is taken depending if the "tocmd" entry is 
undefined or is set to an empty string.


>> Is it possible in a local .git/config to unset/delete an entry?


For those interested and having the same problem with git sendemail, 
here is a workaround that is working, though not very elegant, in my 
local .git/config:


[sendemail]
  smtpServer = alternate-mail-server.com
  smtpUser = ""
  smtpServerPort = ""
  tocmd = /usr/bin/true
  cccmd = /usr/bin/true

Hugo.

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/6e8aa0bb-5123-ad19-fc2a-d327625a0e9e%40gmail.com.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-03 Thread Hugo Villeneuve

On 5/3/23 15:15, Tassilo Horn wrote:

Hugo Villeneuve  writes:

Hi Hugo,


I have a global git settings in /etc/git/config that I use for most of
my projects:

[sendemail]
 smtpUser = my-username
 smtpServer = mail.my-server.com
 smtpServerPort = 2525
 tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nol"
 cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nom"

However, for a particular project, I must use a different sendemail
configuration. I have added this to my .git/config file in this
project:

[sendemail]
 smtpServer = alternate-mail-server.com

For this, I do not want to use the global entries like smtpUser,
tocmd, etc. Unfortunately, these entries are set to the default value
in /etc/config.


Yes, but you could explicitly set them to empty strings in your
project's .git/config.


Hi Tassilo,
no, I tried it and it doesn't work.

Setting an entry to an empty string is not the same as having this entry 
"not defined" for some applications.


For example, if you look at the git sendemail source code, you will see 
take a different action is taken depending if the "tocmd" entry is 
undefined or is set to an empty string.



Is it possible in a local .git/config to unset/delete an entry?


I've tried "git config --local --unset some.option" which actually only
deletes the some.option if it is there.  It does not add an entry with
empty value to override what's in some less specific git config.  For
that, you can do "git config --local some.option ''", i.e., pass the
empty string value yourself.

With your example, you could write something like

--8<---cut here---start->8---
[sendemail]
  smtpServer = alternate-mail-server.com
  smtpUser =
  smtpServerPort =
  tocmd =
  cccmd =
--8<---cut here---end--->8---


I do NOT want to use an external command like 'git config' to do it.


Why?  And why "external"?  I cheated and used this command to figure out
what exactly I would need to write in the git config file.


Because I don't want to run a script each time I want to call git sendmail.

Hugo.

--
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/6dd8abbd-694f-adf6-bbf2-2ba2e0d76a6e%40gmail.com.


Re: [git-users] How to delete an entry in a local git configuration file

2023-05-03 Thread Tassilo Horn
Hugo Villeneuve  writes:

Hi Hugo,

> I have a global git settings in /etc/git/config that I use for most of
> my projects:
>
> [sendemail]
> smtpUser = my-username
> smtpServer = mail.my-server.com
> smtpServerPort = 2525
> tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback 
> --norolestats --nol"
> cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback 
> --norolestats --nom"
>
> However, for a particular project, I must use a different sendemail
> configuration. I have added this to my .git/config file in this
> project:
>
> [sendemail]
> smtpServer = alternate-mail-server.com
>
> For this, I do not want to use the global entries like smtpUser,
> tocmd, etc. Unfortunately, these entries are set to the default value
> in /etc/config.

Yes, but you could explicitly set them to empty strings in your
project's .git/config.

> Is it possible in a local .git/config to unset/delete an entry?

I've tried "git config --local --unset some.option" which actually only
deletes the some.option if it is there.  It does not add an entry with
empty value to override what's in some less specific git config.  For
that, you can do "git config --local some.option ''", i.e., pass the
empty string value yourself.

With your example, you could write something like

--8<---cut here---start->8---
[sendemail]
 smtpServer = alternate-mail-server.com
 smtpUser =
 smtpServerPort =
 tocmd =
 cccmd =
--8<---cut here---end--->8---

> I do NOT want to use an external command like 'git config' to do it.

Why?  And why "external"?  I cheated and used this command to figure out
what exactly I would need to write in the git config file.

Bye,
Tassilo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87a5ylusg1.fsf%40gnu.org.


[git-users] How to delete an entry in a local git configuration file

2023-05-03 Thread Hugo Villeneuve
I have a global git settings in /etc/git/config that I use for most of my 
projects:

[sendemail]
smtpUser = my-username
smtpServer = mail.my-server.com
smtpServerPort = 2525
tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback 
--norolestats --nol"
cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback 
--norolestats --nom"

However, for a particular project, I must use a different sendemail 
configuration. I have added this to my .git/config file in this project:

[sendemail]
smtpServer = alternate-mail-server.com

For this, I do not want to use the global entries like smtpUser, tocmd, 
etc. Unfortunately, these entries are set to the default value in 
/etc/config.

Is it possible in a local .git/config to unset/delete an entry?

I do NOT want to use an external command like 'git config' to do it.

Thank you,


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d98a497c-01bc-401d-bcdc-1fa7c40c9dd6n%40googlegroups.com.


Re: [git-users] how is name-rev determined

2023-03-23 Thread Uwe Brauer

> On Wed, Mar 22, 2023 at 2:37 PM Uwe Brauer  wrote:

> Yes. "branches/default", and "branches/stable".


> Yes.


> If it's named "bug-fix" it's created as a bookmark, if it's named
> "branches/bug-fix", it's created as a branch.

> But since Git has the notion of refspecs, you can choose on the fly:

> git push origin bug-fix:branches/bug-fix

Very cool. I have to try this out and see whether it fits to my
workflow. Thanks very much, I have know that there other tools (besides
hg-git), but I did not realize that yours work in both ways.

Thanks very much for pointing that out to me (and writing the tool of course)

> No. I stopped working on git-remote-hg for a while, and topics came afterward.

> I haven't investigated how to implement them, but it would be nice.

Regards



> Cheers.

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87jzz8kkdn.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how is name-rev determined

2023-03-22 Thread Felipe Contreras
On Wed, Mar 22, 2023 at 2:37 PM Uwe Brauer  wrote:
>
> >>> "FC" == Felipe Contreras  writes:
>
> > On Thu, Mar 16, 2023 at 3:26 PM Uwe Brauer  wrote:
> >> > I wrote the equivalent of hg-git for the git world: git-remote-hg [1],
> >> > and there exporting named branches works fine. They have the
> >> > "branches/" prefix and only one head is tracked.
> >>
> >> Do you mean exporting named hg branches into git branches? Yes that
> >> seems ok, the other way around is the challenge,
>
> > No, I mean from git to hg.
>
> > If a ref has a "branches/" prefix, it's considered an hg branch, and
> > all the commits pushed to that branch get tagged.
>
> Let me try to get this straight.
>
> 1. Suppose there is a mercurial repository in say sourceforge, that
>contains two named branches:, default and stable.
>
> 2. You clone that repository with your plugin into a git repository.
>I presume the named branches end up in the corresponding git
>branches.

Yes. "branches/default", and "branches/stable".

> 3. You make two commits on default and three commit on the stable branch.
>
> 4. You push (since you have write access), and all commits end up
>in the correct named hg branch?

Yes.

> 5. What happens if you create an additional git branch, say bug-fix
>and make a couple of commits and  push. Do they end up as a new
>named branch called bug-fix, or as a bookmark, or can you chose
>between both?

If it's named "bug-fix" it's created as a bookmark, if it's named
"branches/bug-fix", it's created as a branch.

But since Git has the notion of refspecs, you can choose on the fly:

git push origin bug-fix:branches/bug-fix

> 6. What's about topics, do you also support these?

No. I stopped working on git-remote-hg for a while, and topics came afterward.

I haven't investigated how to implement them, but it would be nice.

Cheers.

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s3CbZYW-GH587z00X1xp8Mx%2BLEKgmsKhB%3DbaoxbhKsV-Q%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-22 Thread Uwe Brauer
>>> "FC" == Felipe Contreras  writes:

> On Thu, Mar 16, 2023 at 3:26 PM Uwe Brauer  wrote:
>> > I wrote the equivalent of hg-git for the git world: git-remote-hg [1],
>> > and there exporting named branches works fine. They have the
>> > "branches/" prefix and only one head is tracked.
>> 
>> Do you mean exporting named hg branches into git branches? Yes that
>> seems ok, the other way around is the challenge,

> No, I mean from git to hg.

> If a ref has a "branches/" prefix, it's considered an hg branch, and
> all the commits pushed to that branch get tagged.

Let me try to get this straight.

1. Suppose there is a mercurial repository in say sourceforge, that
   contains two named branches:, default and stable.

2. You clone that repository with your plugin into a git repository.
   I presume the named branches end up in the corresponding git
   branches.

3. You make two commits on default and three commit on the stable branch.

4. You push (since you have write access), and all commits end up
   in the correct named hg branch?

5. What happens if you create an additional git branch, say bug-fix
   and make a couple of commits and  push. Do they end up as a new
   named branch called bug-fix, or as a bookmark, or can you chose
   between both?

6. What's about topics, do you also support these?

Well 6. is not that important, but if the workflow described in 1-5 is
true, then that would be excellent and solve quite some problems on my
side. That would be,  as the US-Americans say, awesome.

I would use your plugin to pull from a git repository and would push then to
my local hg repository.

Thanks and regards



-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87ilesmsjr.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how is name-rev determined

2023-03-22 Thread Felipe Contreras
On Thu, Mar 16, 2023 at 3:26 PM Uwe Brauer  wrote:

> > I wrote the equivalent of hg-git for the git world: git-remote-hg [1],
> > and there exporting named branches works fine. They have the
> > "branches/" prefix and only one head is tracked.
>
> Do you mean exporting named hg branches into git branches? Yes that seems ok, 
> the other way around is the challenge,

No, I mean from git to hg.

If a ref has a "branches/" prefix, it's considered an hg branch, and
all the commits pushed to that branch get tagged.

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s3aNptf%3DjZNAwM%2B-su63vh6%2B-wrMtDeS%2BewNiy22Yr3ug%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-16 Thread Uwe Brauer

> On Sat, Mar 11, 2023 at 1:11 PM Uwe Brauer  wrote:

> You are a much more positive person than me. I've had countless
> discussions with positive reactions who lead to nothing. It seems this
> is going to be another one of those.

Or just more naive 


> After just one reply it has been completely ignored. I guess if Google
> or Microsoft isn't going to pay for this no git developer is going to
> bother taking a look at it.


> I wrote the equivalent of hg-git for the git world: git-remote-hg [1],
> and there exporting named branches works fine. They have the
> "branches/" prefix and only one head is tracked.

Do you mean exporting named hg branches into git branches? Yes that seems ok, 
the other way around is the challenge, but the current hg-git developers want 
to focus on improving hg bookmarks, but this is a promise that has been around 
for ages, with very little progress, if any at all. 

> Of course they are not commit labels like in hg, but a hack can be
> enabled to store the name of the branch on every commit like hg-git
> does with the hg-git-compat option.

> I don't personally care about that but the option is there for those who do.

Which is good.


> Cheers.

> [1] https://github.com/felipec/git-remote-hg

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87ttyke6av.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how is name-rev determined

2023-03-16 Thread Felipe Contreras
On Sat, Mar 11, 2023 at 1:11 PM Uwe Brauer  wrote:
>
> > On Thu, Mar 9, 2023 at 8:07 PM Felipe Contreras
> >  wrote:
>
> > FWIW I updated the patches and sent them to the dev mailing list so
> > they stay on the record:
>
> > https://lore.kernel.org/git/camp44s0cbum1jzyp57ninikwsxg9kugbkdaoozmnen1akvg...@mail.gmail.com/T/#t
>
> I just skimmed over the thread. It seems that the reactions were not
> negative, so there is some hope.

You are a much more positive person than me. I've had countless
discussions with positive reactions who lead to nothing. It seems this
is going to be another one of those.

After just one reply it has been completely ignored. I guess if Google
or Microsoft isn't going to pay for this no git developer is going to
bother taking a look at it.

> Concerning mercurial topics, well it is part of the evolve extension,
> which is not part of mercurial core, but on the other hand the evolve
> extension is now quite stable so I would not call it experimental, but
> anyhow never mind.
> Exporting named branches to git branches (for the hg-git extension) is
> unfortunately experimental.

I wrote the equivalent of hg-git for the git world: git-remote-hg [1],
and there exporting named branches works fine. They have the
"branches/" prefix and only one head is tracked.

Of course they are not commit labels like in hg, but a hack can be
enabled to store the name of the branch on every commit like hg-git
does with the hg-git-compat option.

I don't personally care about that but the option is there for those who do.

Cheers.

[1] https://github.com/felipec/git-remote-hg

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s3A3JJ8TG%3D9jGHE4bz_-HeGHry7At6igghGNg6Kcf9maw%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-11 Thread Uwe Brauer

> On Thu, Mar 9, 2023 at 8:07 PM Felipe Contreras
>  wrote:


> FWIW I updated the patches and sent them to the dev mailing list so
> they stay on the record:

> https://lore.kernel.org/git/camp44s0cbum1jzyp57ninikwsxg9kugbkdaoozmnen1akvg...@mail.gmail.com/T/#t


I just skimmed over the thread. It seems that the reactions were not
negative, so there is some hope.

Concerning mercurial topics, well it is part of the evolve extension,
which is not part of mercurial core, but on the other hand the evolve
extension is now quite stable so I would not call it experimental, but
anyhow never mind.
Exporting named branches to git branches (for the hg-git extension) is
unfortunately experimental.


And the evolve extension seems really to be necessary to have a better 
 git<-->hg 
interaction

Thanks again for pushing this idea forward, independent of hg-git, I find
it very helpful.

bye

> Cheers.

> -- 
> Felipe Contreras

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87edpvcddi.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how is name-rev determined

2023-03-11 Thread Uwe Brauer

> On Thu, Mar 9, 2023 at 8:07 PM Felipe Contreras
>  wrote:


> FWIW I updated the patches and sent them to the dev mailing list so
> they stay on the record:

Thanks!



I have not heard anything back from the hg-git guys, at some point they
told me they want bookmarks to be more than git branches, but 
this has been on the screen for years without any effort as far as I can
see. 

I have the feeling it would be much better to make topics more compatible
with git branches.


> https://lore.kernel.org/git/camp44s0cbum1jzyp57ninikwsxg9kugbkdaoozmnen1akvg...@mail.gmail.com/T/#t

Let's cross our fingers.

> Cheers.

> -- 
> Felipe Contreras

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87wn3ncftu.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how is name-rev determined

2023-03-11 Thread Felipe Contreras
On Thu, Mar 9, 2023 at 8:07 PM Felipe Contreras
 wrote:
>
> On Wed, Mar 8, 2023 at 2:28 PM Uwe Brauer  wrote:
> >
> > > On Mon, Mar 6, 2023 at 3:03 PM Uwe Brauer  wrote:

> > And it seems that in
> > https://felipec.wordpress.com/2013/08/27/analysis-of-hg-and-git-branches/
> >
> > (https://github.com/felipec/git/commits/fc/base is a dead link)
>
> I've updated the link, it changed to fc/tail [1].

FWIW I updated the patches and sent them to the dev mailing list so
they stay on the record:

https://lore.kernel.org/git/camp44s0cbum1jzyp57ninikwsxg9kugbkdaoozmnen1akvg...@mail.gmail.com/T/#t

Cheers.

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s2hFey5gVd%3DXTmHpx5ROQYkn4UdtvTub3txiSTu8Sw13A%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-09 Thread Felipe Contreras
On Wed, Mar 8, 2023 at 2:28 PM Uwe Brauer  wrote:
>
> > On Mon, Mar 6, 2023 at 3:03 PM Uwe Brauer  wrote:

> > It's probably never going to be. The point is that you wouldn't need
> > named branches if you knew from where a branch started.
>
> I am a bit confused, in an earlier mail you said
>
> ,
> | But there are some corner cases in which git is not able to provide
> | the same information as mercurial, because it doesn't have the branch
> | point (the precise point where a branch was created). There's many
> | potential ways to calculate this branch point [2], but there isn't a
> | single infallible solution.
> |
> | Git truly needs to be fixed in order to support this, I proposed a
> | branch@{tail} notation [3].
> `

You could say my relationship with Git developers is complicated. Even
though I do a ton of Git development (maybe the person that does the
most for free), I wouldn't consider myself a "Git developer" ™.

So it doesn't matter if I (and many people) consider such feature
useful, it won't be merged.

> And it seems that in
> https://felipec.wordpress.com/2013/08/27/analysis-of-hg-and-git-branches/
>
> (https://github.com/felipec/git/commits/fc/base is a dead link)

I've updated the link, it changed to fc/tail [1].

> Your proposed a patch and said it was not that difficult.

It's not.

The difficulty relies not on the implementation, but convincing Git
developers that this is useful (even needed).

> > This is hypothetical of course, in truth all you get is what `git
> > name-rev` gives you.
>
> A part from my personal preference to have it, I would also say that
> could be very useful for improving hg <--> git export/import.

Indeed. I don't like Mercurial, but being forced to work with it has
made me see areas of improvement within Git, and this is one of them.

Cheers.

[1] https://github.com/felipec/git/commits/fc/tail

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s1SBEsNjOzp3PaJZLhMuO4vvM2wTP9kLxBMBrQ4ASfHKA%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-06 Thread Felipe Contreras
On Mon, Mar 6, 2023 at 8:41 AM Uwe Brauer  wrote:
>
>
> > On Sat, Mar 4, 2023 at 1:39 AM Uwe Brauer  wrote:
>
> > It's calculated on the fly.
>
> Ok, that I was afraid of.
>
> > Weirdly enough, I wrote a blog post [1] about a debate in 2012
> > precisely about the differences between git and mercurial, and how
> > `git name-rev` can be used to simulate mercurial branches (for the
> > most part).
>
> > But there are some corner cases in which git is not able to provide
> > the same information as mercurial, because it doesn't have the branch
> > point (the precise point where a branch was created). There's many
> > potential ways to calculate this branch point [2], but there isn't a
> > single infallible solution.
>
> > Git truly needs to be fixed in order to support this, I proposed a
> > branch@{tail} notation [3].
>
> That would be great, in the meantime name-rev is good enough for me in
> most cases. I have to admit that for larger repositories I still feel
> more comfortable using mercurial (one of the reasons is named branches)
>
> Now since quite a while the hg-git converter exports named branches to git
> branches (although that is still not officially supported)
>
> The problem is how to import git branches into named branches (right now
> they are converted to mercurial bookmarks).
> The problem is if name-ref is calculated by git on the fly, then one
> would need somehow first pull with the git the repository and then
> import the local repository to mercurial.

Yes, git branches are more akin to hg bookmarks, although nowadays
there's the concept of hg topics, which is even closer.

I've personally never needed some sort of per-commit label (hg
branches), but sometimes I've lacked some marker to where a git branch
was started from. I believe that's the only instance in which hg
branches might give some benefit, but the same could be achieved with
branch@{tail}.

If branch@{tail} was available git name-rev would provide *exactly*
the same information as hg branches (in useful cases).

Cheers.

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s338dG3%3DE7tpxN-aYkrgx_qr2hjrWXWpAqmz%3Do0NEEYnQ%40mail.gmail.com.


Re: [git-users] how is name-rev determined

2023-03-06 Thread Uwe Brauer



Last try
>>> "UB" == Uwe Brauer  writes:

>> On Sat, Mar 4, 2023 at 1:39 AM Uwe Brauer  wrote:

>> It's calculated on the fly.

 Ok, that I was afraid of.

> Weirdly enough, I wrote a blog post [1] about a debate in 2012
> precisely about the differences between git and mercurial, and how
> `git name-rev` can be used to simulate mercurial branches (for the
> most part).

> But there are some corner cases in which git is not able to provide
> the same information as mercurial, because it doesn't have the branch
> point (the precise point where a branch was created). There's many
> potential ways to calculate this branch point [2], but there isn't a
> single infallible solution.

> Git truly needs to be fixed in order to support this, I proposed a
> branch@{tail} notation [3].

 That would be great, in the meantime name-rev is good enough for me in
 most cases. I have to admit that for larger repositories I still feel
 more comfortable using mercurial (one of the reasons is named branches)

 Now since quite a while the hg-git converter exports named branches to git
 branches (although that is still not officially supported)

 The problem is how to import git branches into named branches (right now
 they are converted to mercurial bookmarks). 
 The problem is if name-ref is calculated by git on the fly, then one
 would need somehow first pull with the git the repository and then
 import the local repository to mercurial. 

 Thanks for the clarification.

> But for now `git name-rev` is good enough.

 Right

 Cheers

 Uwe Brauer 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/877cvtq1li.fsf%40mat.ucm.es.


Re: [git-users] how is name-rev determined

2023-03-05 Thread Felipe Contreras
On Sat, Mar 4, 2023 at 1:39 AM Uwe Brauer  wrote:

> However a solution is to use name-rev
>
> Like this
>
> git log   --graph --color=always --all --since=2years --decorate --pretty | 
> git name-rev --annotate-stdin | less -R
>
> And the resulting graph looks, at least for me, close enough to
> mercurial's named branches.
>
> So I am wondering, is this  name-rev information somewhere stored, or
> calculated on the fly each time  the command is called?

It's calculated on the fly.

Weirdly enough, I wrote a blog post [1] about a debate in 2012
precisely about the differences between git and mercurial, and how
`git name-rev` can be used to simulate mercurial branches (for the
most part).

But there are some corner cases in which git is not able to provide
the same information as mercurial, because it doesn't have the branch
point (the precise point where a branch was created). There's many
potential ways to calculate this branch point [2], but there isn't a
single infallible solution.

Git truly needs to be fixed in order to support this, I proposed a
branch@{tail} notation [3].

But for now `git name-rev` is good enough.

Cheers.

[1] 
https://felipec.wordpress.com/2012/05/26/no-mercurial-branches-are-still-not-better-than-git-ones-response-to-jhws-more-on-mercurial-vs-git-with-graphs/
[2] https://stackoverflow.com/questions/1527234/finding-a-branch-point-with-git
[3] https://felipec.wordpress.com/2013/08/27/analysis-of-hg-and-git-branches/

-- 
Felipe Contreras

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAMP44s3J9CjWCaDoo8A3MM-eu%3D%2BToX2S1KRfs%2B1O3nw0V8BKuw%40mail.gmail.com.


[git-users] How to mirror and augment a git repository

2023-03-04 Thread Sebastian Tennant
Hello list,

I wish to mirror _and augment_ an upstream git repository.

Upstream
|
Augmented mirror
  / |   \
Client#1   Client#2   Client#3

Clients of the augmented mirror must have access to everything
available from upstream but must also be able to collaborate on
additional development branches not available from upstream.

Initial approach:

 Augmented mirror:
   
   $ git clone --mirror  upstream
   $ cd upstream
   $ git remote update  # regular cron job

 Clients (bare repo & worktrees preferred):

   $ git clone --bare  mirror
   $ cd mirror
   $ git config remote.origin.fetch\
 "+refs/heads/*:refs/remotes/origin/*"
   $ git remote update

This arrangement worked fine until I decded to run:

   $ git remote prune origin

on the augmented mirror and lost all the additional development
branches the clients had added and shared amongst themselves.

I've tried running the augmented mirror as a plain bare repo, i.e.
   
   $ git config --unset remote.origin.fetch
   $ git config --unset remote.origin.mirror

but then the cron job (git remote update) is no longer sufficient in
making all upstream activity available downstream.

So, how best to run an augmented mirror such as this?

If my initial approach was correct, is there a way to protect the
additional branches so that ‘git remote prune origin’ may be run
safely on the augmented mirror from time to time?

Any help/tips/pointers/suggestions much appreciated.

Sebastian

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d64e3ac0-3bc7-4dad-9c4e-1ea48f3f3684n%40googlegroups.com.


[git-users] how is name-rev determined

2023-03-03 Thread Uwe Brauer


Hi

Since I also use mercurial, one thing I am missing in git, when running
git log --graph

Is a information, which commit belongs to which branch (an information
mercurial provides in named branches)

However a solution is to use name-rev 

Like this

git log   --graph --color=always --all --since=2years --decorate --pretty | git 
name-rev --annotate-stdin | less -R


And the resulting graph looks, at least for me, close enough to
mercurial's named branches.

So I am wondering, is this  name-rev information somewhere stored, or
calculated on the fly each time  the command is called?

Thanks and regards


Uwe Brauer


-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87r0u52cfk.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


[git-users] How to migrate each module of a Maven multi-module project to a new git address

2023-01-03 Thread ronghao zhang

[image: 微信图片_20230104150548.png]
I need to create a new git repository for each module, preferably keeping 
records of all branches and commits

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/e4c9ae04-eeb1-4be5-9b7a-19d00e214900n%40googlegroups.com.


Re: [git-users] how to get list of tags on commits merged to branch X between tags Y and Z

2022-12-18 Thread Graham Menhennitt
Thanks again Konstantin.

In my original message, I said "I want a list of tags attached to commits 
that were merged to X between Y and Z". But in my second message I said it 
wrongly - "list of tags produced by your command includes ones that do not 
belong to branch X". Instead I should have said "list of tags produced by 
your command includes ones that are attached to commits that do not belong 
to branch X".

Does that make more sense?

Thanks,
  Graham
On Friday, December 16, 2022 at 10:16:43 PM UTC+11 Konstantin Khomoutov 
wrote:

> On Thu, Dec 15, 2022 at 02:08:22PM -0800, Graham Menhennitt wrote:
>
> [...]
> >> Note that the branches are irrelevant for traversing. You can use 
> branches
> >> to refer to commits, but any way to refer to them would do; the 
> traversal
> >> process itself is only concerned with commits.
> [...]
> > Unfortunately, that doesn't quite match my requirements - as you say 
> above, 
> > it doesn't filter by branches. So the list of tags produced by your 
> command 
> > includes ones that do not belong to branch X. I'll try to filter it 
> somehow.
>
> While it appears the snippet I have come up with actually helped, it would
> reiterate that tags in Git are never "on" any branch. You can attach tags 
> to
> any "objects" stored in a Git repository: to blobs (a blob is the data of a
> particular version of a particular data), trees (they keep names of the 
> blobs
> serving as directories on filesystems), and commits. Branches are somewhat
> immaterial in this regard: when you do
>
> git tag mytag master
>
> you do not attach a tag "mytag" to the branch "master" or to a commit on
> branch "master"; instead, Git takes than name "master", looks it up, 
> figures
> out it's the name of a branch, _resolves_ it to its tip commit and finally
> attaches the tag "mytag" to that commit. You could then go on and remove 
> the
> branch "master" completely, and that would do nothing to the tag.
>
> When you work with Git, it really helps to stop thinking much about 
> branches
> and start thinking of a graph of commits which refer one another and 
> symbilic
> references to some of these commits. These references are branches and 
> tags.
>
> See, even a sort of obvious
>
> git log master
>
> does not tell Git to traverse commits on the master branch, it tells Git to
> start with the tip commit on the branch "master" and traverse the history
> reachable from that commit. Every commit in that subgraph may be reachable
> from any number of branches - not only "master" - and any number of tags.
> Reachable, bot not "belonging to" or "being on". That's actually a crucial
> concept to absorb to make reasoning about Git much easier.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d64f5be8-5736-46b0-b093-481d075331f1n%40googlegroups.com.


Re: [git-users] how to get list of tags on commits merged to branch X between tags Y and Z

2022-12-16 Thread Konstantin Khomoutov
On Thu, Dec 15, 2022 at 02:08:22PM -0800, Graham Menhennitt wrote:

[...]
>> Note that the branches are irrelevant for traversing. You can use branches
>> to refer to commits, but any way to refer to them would do; the traversal
>> process itself is only concerned with commits.
[...]
> Unfortunately, that doesn't quite match my requirements - as you say above, 
> it doesn't filter by branches. So the list of tags produced by your command 
> includes ones that do not belong to branch X. I'll try to filter it somehow.

While it appears the snippet I have come up with actually helped, it would
reiterate that tags in Git are never "on" any branch. You can attach tags to
any "objects" stored in a Git repository: to blobs (a blob is the data of a
particular version of a particular data), trees (they keep names of the blobs
serving as directories on filesystems), and commits. Branches are somewhat
immaterial in this regard: when you do

  git tag mytag master

you do not attach a tag "mytag" to the branch "master" or to a commit on
branch "master"; instead, Git takes than name "master", looks it up, figures
out it's the name of a branch, _resolves_ it to its tip commit and finally
attaches the tag "mytag" to that commit. You could then go on and remove the
branch "master" completely, and that would do nothing to the tag.

When you work with Git, it really helps to stop thinking much about branches
and start thinking of a graph of commits which refer one another and symbilic
references to some of these commits. These references are branches and tags.

See, even a sort of obvious

  git log master

does not tell Git to traverse commits on the master branch, it tells Git to
start with the tip commit on the branch "master" and traverse the history
reachable from that commit. Every commit in that subgraph may be reachable
from any number of branches - not only "master" - and any number of tags.
Reachable, bot not "belonging to" or "being on". That's actually a crucial
concept to absorb to make reasoning about Git much easier.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20221216111636.3wp76fybvsnidksf%40carbon.


Re: [git-users] how to get list of tags on commits merged to branch X between tags Y and Z

2022-12-15 Thread Graham Menhennitt
Thanks very much for replying, Konstantin.

Unfortunately, that doesn't quite match my requirements - as you say above, 
it doesn't filter by branches. So the list of tags produced by your command 
includes ones that do not belong to branch X. I'll try to filter it somehow.

Thanks,
  Graham

On Friday, December 16, 2022 at 5:40:51 AM UTC+11 Konstantin Khomoutov 
wrote:

> On Tue, Dec 13, 2022 at 08:47:49PM -0800, Graham Menhennitt wrote:
>
> > Our development workflow consists of:
> > 
> > Developer:
> > 
> > - creates private branch off project’s ‘develop’ branch
> > - develops feature or fixes bug on private branch
> > - merges private branch to ‘develop’ branch
> > - creates tag on merge commit identifying feature/bug
> > 
> > Project lead:
> > 
> > - merges project’s ‘develop’ branch to project’s ‘release’ branch
> > - builds release from ‘release’ branch
> > - creates tag on ‘release’ branch to identify release
> > 
> > We want to be able to give our test team a list of the features/bug 
> fixes 
> > in the new release. As such, I want to get list of tags on commits that 
> > have been merged to the project’s ‘release’ branch. I want it restricted 
> to 
> > tags contained in the new release tag, but not contained in the previous 
> > release tag. I want the list to exclude tags on other projects i.e. that 
> > have not been merged to this project’s ‘release’ branch.
> > 
> > So, if this project’s ‘release’ branch is X. The previous release is Y 
> and 
> > the new release is Z. I want a list of tags attached to commits that 
> were 
> > merged to X between Y and Z.
>
> The closest thing I've been able to come up with is
>
> git rev-list --pretty='format:%D' Z ^Y | grep ^tag:
>
> Which basically means:
>
> * Traverse the subgraph of the repository's commits reachable from commit
> tagged by Z...
>
> * ...But exclude any commits also reachable from Y, and...
>
> * For those commits which are referenced (have a branch or a tag pointing
> at them, or both, or multiple) output them as well.
>
> * The output is then filtered to contain only the tags.
>
>
> Note that the branches are irrelevant for traversing. You can use branches 
> to
> refer to commits, but any way to refer to them would do; the traversal 
> process
> itself is only concerned with commits.
>
>
> You might need to further refine the incantation but this should be a 
> start.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/f4172e61-a0d1-4172-96ef-ad085129d8c4n%40googlegroups.com.


Re: [git-users] how to get list of tags on commits merged to branch X between tags Y and Z [solved]

2022-12-15 Thread Graham Menhennitt
Thank you, Konstantin. That appears to do exactly what I need.

Thanks,
  Graham
On Friday, December 16, 2022 at 5:40:51 AM UTC+11 Konstantin Khomoutov 
wrote:

> On Tue, Dec 13, 2022 at 08:47:49PM -0800, Graham Menhennitt wrote:
>
> > Our development workflow consists of:
> > 
> > Developer:
> > 
> > - creates private branch off project’s ‘develop’ branch
> > - develops feature or fixes bug on private branch
> > - merges private branch to ‘develop’ branch
> > - creates tag on merge commit identifying feature/bug
> > 
> > Project lead:
> > 
> > - merges project’s ‘develop’ branch to project’s ‘release’ branch
> > - builds release from ‘release’ branch
> > - creates tag on ‘release’ branch to identify release
> > 
> > We want to be able to give our test team a list of the features/bug 
> fixes 
> > in the new release. As such, I want to get list of tags on commits that 
> > have been merged to the project’s ‘release’ branch. I want it restricted 
> to 
> > tags contained in the new release tag, but not contained in the previous 
> > release tag. I want the list to exclude tags on other projects i.e. that 
> > have not been merged to this project’s ‘release’ branch.
> > 
> > So, if this project’s ‘release’ branch is X. The previous release is Y 
> and 
> > the new release is Z. I want a list of tags attached to commits that 
> were 
> > merged to X between Y and Z.
>
> The closest thing I've been able to come up with is
>
> git rev-list --pretty='format:%D' Z ^Y | grep ^tag:
>
> Which basically means:
>
> * Traverse the subgraph of the repository's commits reachable from commit
> tagged by Z...
>
> * ...But exclude any commits also reachable from Y, and...
>
> * For those commits which are referenced (have a branch or a tag pointing
> at them, or both, or multiple) output them as well.
>
> * The output is then filtered to contain only the tags.
>
>
> Note that the branches are irrelevant for traversing. You can use branches 
> to
> refer to commits, but any way to refer to them would do; the traversal 
> process
> itself is only concerned with commits.
>
>
> You might need to further refine the incantation but this should be a 
> start.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/fd27c629-aaad-4edd-a104-2cbc96c6964fn%40googlegroups.com.


Re: [git-users] how to get list of tags on commits merged to branch X between tags Y and Z

2022-12-15 Thread Konstantin Khomoutov
On Tue, Dec 13, 2022 at 08:47:49PM -0800, Graham Menhennitt wrote:

> Our development workflow consists of:
> 
> Developer:
> 
>- creates private branch off project’s ‘develop’ branch
>- develops feature or fixes bug on private branch
>- merges private branch to ‘develop’ branch
>- creates tag on merge commit identifying feature/bug
> 
> Project lead:
> 
>- merges project’s ‘develop’ branch to project’s ‘release’ branch
>- builds release from ‘release’ branch
>- creates tag on ‘release’ branch to identify release
> 
> We want to be able to give our test team a list of the features/bug fixes 
> in the new release. As such, I want to get list of tags on commits that 
> have been merged to the project’s ‘release’ branch. I want it restricted to 
> tags contained in the new release tag, but not contained in the previous 
> release tag. I want the list to exclude tags on other projects i.e. that 
> have not been merged to this project’s ‘release’ branch.
> 
> So, if this project’s ‘release’ branch is X. The previous release is Y and 
> the new release is Z. I want a list of tags attached to commits that were 
> merged to X between Y and Z.

The closest thing I've been able to come up with is

  git rev-list --pretty='format:%D' Z ^Y | grep ^tag:

Which basically means:

 * Traverse the subgraph of the repository's commits reachable from commit
   tagged by Z...

 * ...But exclude any commits also reachable from Y, and...

 * For those commits which are referenced (have a branch or a tag pointing
   at them, or both, or multiple) output them as well.

 * The output is then filtered to contain only the tags.


Note that the branches are irrelevant for traversing. You can use branches to
refer to commits, but any way to refer to them would do; the traversal process
itself is only concerned with commits.


You might need to further refine the incantation but this should be a start.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20221215184044.2g3k5rvvldkycvnt%40carbon.


[git-users] how to get list of tags on commits merged to branch X between tags Y and Z

2022-12-13 Thread Graham Menhennitt
 

Hello gitters,

Our development workflow consists of:

Developer:

   - creates private branch off project’s ‘develop’ branch
   - develops feature or fixes bug on private branch
   - merges private branch to ‘develop’ branch
   - creates tag on merge commit identifying feature/bug

Project lead:

   - merges project’s ‘develop’ branch to project’s ‘release’ branch
   - builds release from ‘release’ branch
   - creates tag on ‘release’ branch to identify release

We want to be able to give our test team a list of the features/bug fixes 
in the new release. As such, I want to get list of tags on commits that 
have been merged to the project’s ‘release’ branch. I want it restricted to 
tags contained in the new release tag, but not contained in the previous 
release tag. I want the list to exclude tags on other projects i.e. that 
have not been merged to this project’s ‘release’ branch.

So, if this project’s ‘release’ branch is X. The previous release is Y and 
the new release is Z. I want a list of tags attached to commits that were 
merged to X between Y and Z.

Any clues, please? Thanks in advance for any help.

Regards,

Graham

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/fca01cba-9ab9-46c0-b9fa-211c816dfd6en%40googlegroups.com.


[git-users] How to best maintain directories like /etc/sysstat in GIT?

2022-10-12 Thread Thorsten Schöning
Hi everyone,

I'm using SVN to maintain lots of different host specific configs like
crontab files, web server configs and the directory /etc/sysstat. The
current approach is to simply have some directory structure in trunk
named by topics like /trunk/Mail/Postfix for some reference host, if
any such host makes sense at all. That config is then copied to e.g.
/tags/Mail/Postfix/other.host and Postfix for that host maintained in
that writable tag. 

GIT doesn't have writable tags, which might be worked around using
branches or one repo per host or stuff. The more important difference
is that SVN can have a working copy for each and every maintained
directory. So one can really make /etc/postfix or /etc/sysstat a
working copy and maintaine that only, without additionally necessary
subdirs and without having .svn in /etc or alike. AFAIK that is not
possible in GIT, even with sparse checkouts one needs a subdir of
some kind, which is pretty incompatible with many system wide configs.
Unless one wants to put .git into / or /etc or alike, which is what I
would like to avoid.

**Any useful suggestions for workarounds?**

I can only think of two things: Putting the GIT clone somewhere and
link directories into that. Which won't work very well for directories
for which I only want to maintain some and not all files and seems
like a lot of work, might break package management etc.

The other thing I have in mind is using branches and their implicit
available ROOT. So I would create "etc/sysstat" as branch name, clone
some repo into /etc/sysstat and checkout the corresponding branch
name. That branch would only contain the files for that directory. For
other directories other branch names would need to be created, e.g.
"var/spool/cron/crontabs". The problems I see are with introducing
host names, branch name lengths and stuff, though host names could
easily be individual repos again.

**Any further ideas? Thanks!**

Mit freundlichen Grüßen

Thorsten Schöning

-- 
AM-SoFT IT-Service - Bitstore Hameln GmbH
Mitglied der Bitstore Gruppe - Ihr Full-Service-Dienstleister für IT und TK

E-Mail: thorsten.schoen...@am-soft.de
Web:http://www.AM-SoFT.de/

Tel:   +49 5151-  9468- 0
Tel:   +49 5151-  9468-55
Mobil: +49  178-8 9468-04

AM-SoFT IT-Service - Bitstore Hameln GmbH, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 221853 - Geschäftsführer: Janine Galonska


Für Rückfragen stehe ich Ihnen jederzeit zur Verfügung. 

Mit freundlichen Grüßen, 

Thorsten Schöning


Telefon: +49 5151 9468-55
Fax: 
E-Mail: tschoen...@am-soft.de

AM-Soft IT-Service - Bitstore Hameln GmbH
Brandenburger Straße 7c
31789 Hameln

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen 
und ist ausschliesslich für den Adressaten bestimmt. Jeglicher Zugriff auf 
diese E-Mail durch andere Personen als den Adressaten ist untersagt. Wenn Sie 
nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, 
informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. 
Sollten Sie nicht der für diese E-Mail bestimmte Adressat sein, ist Ihnen jede 
Veröffentlichung, Vervielfältigung oder Weitergabe wie auch das Ergreifen oder 
Unterlassen von Massnahmen im Vertrauen auf erlangte Information untersagt. 

This e-mail may contain confidential and/or privileged information and is 
intended solely for the addressee. Access to this email by anyone else is 
unauthorized. If you are not the intended recipient (or have received this 
e-mail in error) please notify the sender immediately and destroy this e-mail. 
If you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, is prohibited and 
may be unlawful. 

Hinweise zum Datenschutz: bitstore.group/datenschutz



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/1365116723.20221012194225%40am-soft.de.


[git-users] How to resolve merge conflicts on octopus merges

2022-05-13 Thread Johannes Lippmann
Hello, 

I would like to merge multiple branches in one commit and resolve the merge 
conflicts by hand.
I was suprised to learn that this doesn't seem to be possible with git and 
am looking for a solution.

My (simplified) situation is like this:

I have a (python) project, versioned with git.
It's dependencies with versions are specified in a file called 
`pyproject.toml`.
There is also a file called `poetry.lock` which holds a lot of stuff, but 
also a hash over the project when the dependencies are installed.
Calculating this hash can only be done by really installing the packages, 
which is somewhat expensive (takes a view seconds).

Then there is a bot (dependabot) which will update single packages on a new 
branch.
This changes both of the files mentioned above.
Let's say there are 3 of those dependabot branches: `update-dep-1`, 
`update-dep-2` and `update-dep-3`.
Now how should I merge them into main?

Idea 1: I could merge them one by one. 
- `git merge update-dep-1` (no problems)
- `git merge update-dep-2` (merge conflict on `poetry.lock`, I have to 
regenerate this file)
- `git merge update-dep-3` (another merge conflict on `poetry.lock`, I have 
to regenerate this file)
As you see, I have to do the expensive recalculation n-1 times for n 
branches.
So this is not a nice workflow.

Idea 2: I would like to do an octopus merge:
`git merge update-dep-1 update-dep-2 update-dep-3` (with single merge 
conflict)
I would then regenerate the `poetry.lock` once and be done with it.

But unfortunatelly it seems that git wouldn't let me do an octopus merge 
where there are conflict.

Fast-forwarding to: update-dep-1
Trying simple merge with update-dep-2
Simple merge did not work, trying automatic merge.
Auto-merging poetry.lock
ERROR: content conflict in poetry.lock
Auto-merging pyproject.toml
fatal: merge program failed
Automated merge did not work.
Should not be doing an octopus.
Merge with strategy octopus failed.

Does anybody have an idea on how to make this work?
I would really like to hear your input on this.

Yours,
Johannes

PS: I have attached a small bash-script to build a minimal example of the 
problem,
run it in an empty directory.
(Of course review it before, you wouldn't run random bash scripts from 
strangers, would you?)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/4923837c-e5d4-4494-b358-a894101071c1n%40googlegroups.com.


[git-users] How to know the push time

2022-04-25 Thread 许涛
I'm a programmer from China, and I have a question when I use git, that I 
can't get the push time of the code. git seems to only log commit times. 
For example, if a colleague of mine commits the code to the local 
repository on Sunday, and does not push it to the remote repository until 
next Tuesday. As an operation and maintenance, if I pull on Monday, I will 
not get any updates. Wait until I do a pull on Tuesday and I'll get an 
update. But I found that git log records the commit time and the date is 
Sunday. Unless the developer tells me that he pushes on a Tuesday, I won't 
know when he pushes. In response to this question, please answer it, or 
record the push time on git. I think this may be easy to implement and 
necessary. Looking forward to your answers. thank you very much.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/811af8bf-3019-4c82-a0cb-68d349b36cf4n%40googlegroups.com.


[git-users] How to implement WebRTC as a Git Protocol?

2022-02-19 Thread git noob
Hi,

https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols
https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols

Is there a way to use plumbing commands (internal transfer protocols?) to 
implement your own Git protocol over WebRTC? If you could somehow generate 
all the files necessary to update your Git repository ('git pull') and 
instead of sending them over a standard protocol, you would use WebRTC data 
channels to send that data instead. And on the receiving end, use the 
received files to update your repo.

Or maybe there already exists a Git-over-WebRTC library?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d37b3ab1-26d8-4aa9-867f-5bb278ec5953n%40googlegroups.com.


[git-users] How to change git clone --mirror into git clone ?

2022-01-26 Thread skybuck2000
I want to experiment with worktrees. I am investigating the possibility of 
git clone --bare and git clone --mirror.

git clone --mirror does something interesting it re-creates all local 
branches, which is something that git clone does not do which kinda sucks.

However git clone --mirror has an issue for me, git log --graph --all shows 
no remote branches... and git branch -r also shows no remote branches.

I also tried setting some refs, not sure what I am doing, tried this:
$ git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
and this:
$ git config remote.origin.mirror false

both on the git clone --mirror repo... which is also stored a bit strangely 
in reponame.git instead of .git

anyway after doing git log --graph --all no remotes show up, the red things 
? So how I can I use a git clone --mirror and work with remotes ? Or is 
this now possible or adviceable ?

Another possibility would be to edit the existing git clone repo and try 
and move the default worktree to somewhere else.

As far as I know there is no git clone command to set a different worktree 
for master ?

What I ultimately would like to do, sort of is:

git clone anyrepo.

but set the master branch to \master

Or perhaps \worktrees\master

to make it even more clear
and then another branch say feature branch
\worktrees\feature

So that final repo would look something like:

\.git
\Worktrees\Master
\Worktrees\Feature

I would prefer it even more if

.git was in a seperate folder so full example:


E:\SourceCode\Project\GitRepository.git
E:\SourceCode\Project\Master
E:\SourceCode\Project\Feature

However the annoying thing is when
git status is done on E:\SourceCode\Project it will complain and will say 
.git not found or whatever.

Is there a way to tell git that it should look for one higher subfolder to 
be able to stay away from \GitRepository.git subfolder in case of 
accidental deletions.

So that I want to delete a worktree folder and check it out, currently it's 
very risky to delete any worktree because .git is inside of it... I would 
prefer if .git repo is kept elsewhere to prevent such deletion 
risks/mistakes.

Alternatively the above would become:

E:\SourceCode\Project\.git
E:\SourceCode\Project\WorkTrees\Master
E:\SourceCode\Project\WorkTrees\Feature

This will also do but is less ideal... longer folder names... 

Bye for now.
  Skybuck.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/f1033918-553e-4d71-9587-31ee453026b0n%40googlegroups.com.


Re: [git-users] How to print out a git repo (local)

2021-12-22 Thread Matthew Singletary
David,
 What exactly do you want to see?
  The files in the repo? If so, you could just use `ls` or `dir`.
  If you wanted to see the commits, you could use git-log (or similar, more
advanced commands).

Matt


On Wed, Dec 22, 2021 at 10:05 AM David McMurrey  wrote:

> I have  looked and looked to see how we can print out or display the
> contents of a local repo. I thought git-cat was the answer then git print
> origin.
>
> When we have finished a git project, we need to display it as a regular
> document. How is that done?
>
> -- David
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/git-users/48d35100-4473-445f-8589-509ecd278e73n%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/CAAJ-tZLtO6EKifvFermov8KNqsBYoeYPu4LZRgbE5Djspf%3Djqw%40mail.gmail.com.


[git-users] How to print out a git repo (local)

2021-12-22 Thread David McMurrey
I have  looked and looked to see how we can print out or display the 
contents of a local repo. I thought git-cat was the answer then git print 
origin. 

When we have finished a git project, we need to display it as a regular 
document. How is that done?

-- David

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/48d35100-4473-445f-8589-509ecd278e73n%40googlegroups.com.


[Mystery solved, I owe you an apology] (was: [git-users] how to remove two commits from a remote server)

2021-12-01 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

> On Mon, Nov 29, 2021 at 05:44:51PM +0100, Uwe Brauer wrote:
> [...]

>> Ok, right, I see now that I left out that important part of information. 
>> It should have been
>> 
>> 1. I created the copyright (and copy branch one of them was silly anyway) and
>> 
>> 2. Added two commits into that branch(es), if I remember correctly one
>> commit belonged to two branches (that is possible right?)

> Well, yes and no - depends on how one looks.
> In Git, a commit does not in any way records explicitly which branch it was
> created "on" (and it's possible to record a commit which does not belong to
> any branch even initially), and hence the fact of belonging to a branch is a

[Snip]...


> One way to achieve the situation you have got in with plain Git is:

>   git checkout master

>   git add ...
>   git commit ...

>   ^ repeat twice to create two unneeded commits

>   git branch copy
>   git branch copyright


I see such an operation is impossible in mercurial a commit belongs to
only one and only one branch.


>> 
>> That is were I was  (and still am) confused: I created these branches 
>> locally and
>> then pushed, I thought they would then be in both places: in my local
>> repository and in the remote server repository.

> Now that makes me confused, too, because a sequence of commands I showed above
> would make you end up with the three local branches, and the following "push
> all" command would create remote branches origin/copy and origin/copyright
> (and update origin/master).

> Sure, there was a way to create only remote branches w/o creating local -
> say, by pushing like

>   git push origin HEAD:master HEAD:refs/heads/copy HEAD:refs/heads/copyright

> but I doubt you'd do that in your right mind :-)

> I think it's simpler to assume you have somehow managed to delete those two
> extraneous local branches but forgot about that. Not sure we can find out
> unless you have a history of the shell commands run (and that was a CLI tool -
> which were used for deletion).


I found out what happened. 
I owe you an apology, but on the bright side, I learned a ton new things
about git.

As I said I am one of the maintainer of
matlab-mode(emacs), a git repository in sourceforge. Since I know
mercurial relatively well but don't really understand git (to put it
mildly). I am using the the hg-git plugin, that allows me to do all the
commits merging etc in mercurial and then push to git.

I am usually quite careful and have put several safety layers, a git
sandbox at bitbucket to which I push first and a local git repository I
also push first, check things and then push them to sourceforge.

I was testing things and by mistake pushed directly an unwanted branch to
sourceforge. In mercurial I would now be doomed. I mean I can revert
these changes by an operation called «backout» but the bad commits would
still stay on the server. This is why bitbucket allowed you to delete
these commits using there server API.

I vaguely remembered that git is less strict in this sense.

So I pulled the commits in sourceforge to my local repository and wanted
to clean up things. 


It never occurred to me, that there would be two
type of branches (in mercurial there is only one type of branch, it
commits can be on remote or on local or on both but there is no need to
distinguish both). 
Yes I know git branch -a shows branches, I never really understand them
all.


I only realize by now that git does make a difference and as I must add,
the wording of those is chosen, well poorly I would say.

In any case these pushing and pulling  explains the confusion I also caused.



To summarize 

* master refers to the master branch on my local machine while 


  remotes/origin/HEAD -> origin/master
  remotes/origin/master


Remotes/origin/master

Means the master on the remote server.

Firstly I think 

* local/master

Would be clearer but what I find really confusing is the use of the word
origin in remotes!!!

It should be 

  remotes/HEAD -> remotes/master
  remotes/master

(If I were not  so scared I would be thinking of changing this
configuration)

Rationale.
If I start create a repository, commit commit and finally push it to say
new bitbucket repository then origin for me would be my local repository
where things started. Anyway I do understand that this distinction
exists, (still don't see why) but it is important to know

Thanks and regards

Uwe 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87bl20vdbk.fsf_-_%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [SOLVED] (was: [git-users] how to remove two commits from a remote server)

2021-11-29 Thread Konstantin Khomoutov
On Sun, Nov 28, 2021 at 05:21:41PM +0100, Uwe Brauer wrote:

[...]

> Here is what I did finally and checked also the repository via the
> browser and all is well:
> 
> git push -f origin  c945bf50251150e0d4ad7ee751c7e9615cb4b3e8:master
> git branch -rD origin/copyright
> git branch -rD origin/copy
> git push origin :copy :copyright

Well, this is some advanced Git; glad you've sorted it out!

Still, unfortunately the premises I was basing my guidelines on - that you
actually want to _keep_ those commits and the branches other than master -
were wrong, as we've found out in another part of this thread. (Well, actually
I do not regret my advice because that was the safest default.)

Hence had I guessed better, the sequence would be way simpler and would
involve hard resetting one of the branches - as you've correctly found on SO:

  git checkout master

  git reset --hard c945bf502

  ^ would throw away the unneeded commits from the tip of the history line

  git push -f origin master :copy :copyright

  ^ would force-update the master branch and delete - push nothing to -
the unneeded branches.

  git remote prune origin

  ^ would make sure you have no remote branches not matching existing
branches on origin.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20211129180118.fnkxfglxy27v4qvt%40carbon.


Re: [git-users] how to remove two commits from a remote server

2021-11-29 Thread Konstantin Khomoutov
On Mon, Nov 29, 2021 at 05:44:51PM +0100, Uwe Brauer wrote:

[...]

> Ok, right, I see now that I left out that important part of information. 
> It should have been
> 
> 1. I created the copyright (and copy branch one of them was silly anyway) 
> and
> 
> 2. Added two commits into that branch(es), if I remember correctly one
>commit belonged to two branches (that is possible right?)

Well, yes and no - depends on how one looks.
In Git, a commit does not in any way records explicitly which branch it was
created "on" (and it's possible to record a commit which does not belong to
any branch even initially), and hence the fact of belonging to a branch is a
dynamic properly which, in Git, is defined through the concept of
reachability. A branch is merely a pointer to some commit with the added logic
that when this branch is checked out, and a new commit recorded, it will
update the checked out branch such that it now points to that new commit.
So, if we take a branch, we can inspect the commit it points at, find its
parent commit(s) then the parent commits of those commits and move all the way
down - until we eventually hit one or more "root" commits - those with no
parents. (In Git, graphs of commits are obviously acyclic, so we'll always
guaranteed to arrive at one or more root commits.)

One way to achieve the situation you have got in with plain Git is:

  git checkout master

  git add ...
  git commit ...

  ^ repeat twice to create two unneeded commits

  git branch copy
  git branch copyright

  ^ the branches master, copy and copyright all point at the same commit now.

  git push --all origin

  ^ pushes all existing local branches to the same-named branches in the
remote repo.

[...]
> > That's because the command means "delete the local branches „copy” and
> > „copyright”". From your original post, it wasn't clear you do not have such
> > local branches.
> 
> That is were I was  (and still am) confused: I created these branches locally 
> and
> then pushed, I thought they would then be in both places: in my local
> repository and in the remote server repository.

Now that makes me confused, too, because a sequence of commands I showed above
would make you end up with the three local branches, and the following "push
all" command would create remote branches origin/copy and origin/copyright
(and update origin/master).

Sure, there was a way to create only remote branches w/o creating local -
say, by pushing like

  git push origin HEAD:master HEAD:refs/heads/copy HEAD:refs/heads/copyright

but I doubt you'd do that in your right mind :-)

I think it's simpler to assume you have somehow managed to delete those two
extraneous local branches but forgot about that. Not sure we can find out
unless you have a history of the shell commands run (and that was a CLI tool -
which were used for deletion).

[...]

> Ok thanks for telling me. I will in the future double cautious and first
> push to a sandbox somewhere before pushing to a shared repository.

I would just recommend to unlearn "--all".
Basically, the course of action is as follows:

 1. Inspect the branch you're about to push looks OK (`git log -p`, `gitk` or
whatever else).

 2. Push exactly that branch - with

  git push origin HEAD

supposedly being the most convenient shortcut for "update the branch I'm 
on with the commit it points at".

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20211129175408.fq2mldvvvin3ihy3%40carbon.


Re: [git-users] how to remove two commits from a remote server

2021-11-29 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

> On Sun, Nov 28, 2021 at 09:02:46AM +0100, Uwe Brauer wrote:
> [...]

>>> That wasn't needed; you would have been better off by merely running
>> As I said, I want to get rid of those commits and to check what other
>> users see. When I browse with say firefox the repository the commits are
>> still there.

> I think that is us not sharing the same context ;-)


Oops sorry..
> In your original post, I've seen three branches involved, one of which was
> "master". Most of the time "master" is what maintains the main line of the
> development, and users do not "just see" some commits - they always see them
> on some branch. With these premises in mind, I have assumed you're interested
> in fixing the "master" branch.

Ok, right, I see now that I left out that important part of information. 
It should have been

1. I created the copyright (and copy branch one of them was silly anyway) 
and

2. Added two commits into that branch(es), if I remember correctly one
   commit belonged to two branches (that is possible right?)

3. In any case I pushed these and caused a mess.

4. So I needed to delete/remove the commits and the branches.

>>> git branch -D copy copyright
>> 
>> As I said this give error, but 

> That's because the command means "delete the local branches „copy” and
> „copyright”". From your original post, it wasn't clear you do not have such
> local branches.

That is were I was  (and still am) confused: I created these branches locally 
and
then pushed, I thought they would then be in both places: in my local
repository and in the remote server repository.

>> git branch -rD orgin/copy
>> 
>> Works

> This command deleted the remote branches.
> Well, given the above, this is OK. Not really needed but will hide this
> obsolete stuff from the output of `git log --all`.

> Just for the record

>   git push origin :copy :copyright

> followed by

>   git fetch --prune origin

> or

>   git prune origin

> would get rid of those remote branches as well.

Ok thanks for telling me. I will in the future double cautious and first
push to a sandbox somewhere before pushing to a shared repository.

regards

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/875ysasygs.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to remove two commits from a remote server

2021-11-29 Thread Konstantin Khomoutov
On Sun, Nov 28, 2021 at 09:02:46AM +0100, Uwe Brauer wrote:

[...]

>> That wasn't needed; you would have been better off by merely running
> As I said, I want to get rid of those commits and to check what other
> users see. When I browse with say firefox the repository the commits are
> still there.

I think that is us not sharing the same context ;-)

In your original post, I've seen three branches involved, one of which was
"master". Most of the time "master" is what maintains the main line of the
development, and users do not "just see" some commits - they always see them
on some branch. With these premises in mind, I have assumed you're interested
in fixing the "master" branch.

>>   git branch -D copy copyright
> 
> As I said this give error, but 

That's because the command means "delete the local branches „copy” and
„copyright”". From your original post, it wasn't clear you do not have such
local branches.

> git branch -rD orgin/copy
> 
> Works

This command deleted the remote branches.
Well, given the above, this is OK. Not really needed but will hide this
obsolete stuff from the output of `git log --all`.

Just for the record

  git push origin :copy :copyright

followed by

  git fetch --prune origin

or

  git prune origin

would get rid of those remote branches as well.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20211129155904.m7xnhlxtxsmftycg%40carbon.


[SOLVED] (was: [git-users] how to remove two commits from a remote server)

2021-11-28 Thread Uwe Brauer

> On Fri, Nov 26, 2021 at 10:57:01PM +0100, Uwe Brauer wrote:
> [...]
> [...]
> [...]


Here is what I did finally and checked also the repository via the
browser and all is well:

git push -f origin  c945bf50251150e0d4ad7ee751c7e9615cb4b3e8:master
git branch -rD origin/copyright
git branch -rD origin/copy
git push origin :copy :copyright

Regards

Uwe 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87h7bws12i.fsf_-_%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to remove two commits from a remote server

2021-11-28 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

Two more comments

> That wasn't needed; you would have been better off by merely running

As I said, I want to get rid of those commits and to check what other
users see. When I browse with say firefox the repository the commits are
still there.



>   git branch -D copy copyright

As I said this give error, but 

git branch -rD orgin/copy

Works

(https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely)
>   git push origin :copy :copyright

> (the latter means "push nothing to the „copy” branch" and the same for the
> copyright branch).

> Of course, you might do something else like continue to work on either of
> those branches and merge them to master when they are ready or something like
> this.

> If you need further clarifications or guidance, ask away.

Let's see whether it is possible to really (delete/remove) those commits.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/875yscu2qh.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to remove two commits from a remote server

2021-11-27 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

Hi 

Thanks very much for you detailed answer, I still have one question and
more importantly one problem left.


> On Fri, Nov 26, 2021 at 10:57:01PM +0100, Uwe Brauer wrote:
>> 
>> By that logic I should run 
>> 
>> git push -f origin  c945bf50251150e0d4ad7ee751c7e9615cb4b3e8:master

> That is correct.

>> But this seemed not to have helped. 

> It had - read on ;-)

>> When I clone the repository

> That wasn't needed; you would have been better off by merely running

I cloned the repository again, because, 

1. I wanted to see what other users see if they clone it now

2. If other maintainers fetch or pull (fortunately it seems nobody
   will work at the weekend it ☺️ 



>   git fetch origin

> which would update in your local repository the so-called "remote branches"
> for the remote repo known as "origin". Remote branches are sort of bookmarks
> which capture the state of the branches in a named remote repository last time
> they were observed.

>> I see in a different local directory again adn run 
>> 
>> git log --all 
>> 
>> @commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
>> origin/copy)
> [...]
>> * commit 66380013003549a6851d4e110b29a5a439e05609
> [...]
>> * commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (HEAD -> master, 
>> origin/master, origin/HEAD)
>> 
>> That is these two commits have not been removed.

> They had: please pay attention to the names of the "references" taken in
> parentheses - your two "extra" commits are at the tips of the branches
> named origin/copyright and origin/copy, while origin/master point at the
> correct commit - exactly that you have told remote Git to update its "master"
> branch with.

Ok, well, but I want to get rid of these two commits (mostly because
they are not ready and then the log message just sucks). I recall that
this was possible in bitbucket some time ago (of course with a big big
warning). But as I have to add that was for mercurial which is much more
rigid in deleting already pushed commits (read impossible)

It seems that you propose a command that I just use to get rid of these
commits, see below git branch -D copy
but they do not work, with worries me


> Now please note that there are more info attached to the commit c945bf there:

>  * HEAD -> master tells you that c945bf is the commit currently checked out
>(HEAD always points at the commit which you're working on).
>And the arrow tells you which local branch will be updated should you
>record a new commit.

Ok so far so clear (that is @ in mercurial)

>So this bit tells you that you have the local branch "master" checked out,
>and it has the expected commit at its tip - just what you have requested
>by executing that `git push` command above.

>  * origin/HEAD is of less interest but let's describe it, too.
>The HEAD in a remote repository points at a branch which will be "the
>default" one in the repositories which are created when that remote repo
>is cloned (the books usually say it's "master" but in fact it's what HEAD
>points at).

> In other words, it's the usage of the "--all" command-line option which
> tripped you: should you have examined just origin/master, you'd have seen that
> everything is normal.
> I'll try to expand on those "origin/" prefixes in a moment.

Right that for a mercurial user, is new and confusing.

>> Not sure how to proceed.

> Well, at first, note that all is in green area now.
> You might want to furthr adjust things a bit, if you want, but the "master"
> branch in the remote repository has the state you shought for it to be in your
> initial mail.

For better reading I cut some of these paragraphs 

[Snip]...


> You could then reset your local branch master to that same commit c945bf.
> That could be done by, say,

>   git checkout master
>   git reset --hard origin/master

Aha that indeed makes a different (as a regular mercurial user I am
still confused by the distinction between remote and origin, I mean I
understand in principle its purpose but in practise

I find the difference 
between 
(HEAD -> master)

And 
(HEAD -> master, origin/master, origin/HEAD)

Confusing, shouldn't that be 

(HEAD -> remotes/master)

And 
(HEAD -> master, origin/master, origin/HEAD)

Frankly also 

 git branch -a 

Confuses me since it states
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/copy

I find this confusing because I thought it is either remotes (server) or
origin (local) but not remotes/origin.

> which would make the local master to point at the same commit master in the
> origin repo does.

> Then you might want to get rid of either of those branches - copy and
> copyright, - or both of them.

> If you do not need them both in your local repo and in the remote one, just do

>   git branch -D copy copyright


That is precisely  what I tried to so far 
but I obtain 

branch -D copy
error: branch 'copy' not found.


> If you 

Re: [git-users] how to remove two commits from a remote server

2021-11-27 Thread Konstantin Khomoutov
On Fri, Nov 26, 2021 at 10:57:01PM +0100, Uwe Brauer wrote:

[...]
> I meant I should *NOT* have pushed 
> 
> >> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
> >> origin/copy)
[...]
> >> * commit 66380013003549a6851d4e110b29a5a439e05609
[...]
> In other words I need to remove 
> >> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
> >> origin/copy)
> >> * commit 66380013003549a6851d4e110b29a5a439e05609
> > If yes, then it's simple: do
> >   $ git push -f origin 66380013003:master
> 
> By that logic I should run 
> 
>  git push -f origin  c945bf50251150e0d4ad7ee751c7e9615cb4b3e8:master

That is correct.

> But this seemed not to have helped. 

It had - read on ;-)

> When I clone the repository

That wasn't needed; you would have been better off by merely running

  git fetch origin

which would update in your local repository the so-called "remote branches"
for the remote repo known as "origin". Remote branches are sort of bookmarks
which capture the state of the branches in a named remote repository last time
they were observed.

> I see in a different local directory again adn run 
> 
>  git log --all 
> 
> @commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
> origin/copy)
[...]
> * commit 66380013003549a6851d4e110b29a5a439e05609
[...]
> * commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (HEAD -> master, 
> origin/master, origin/HEAD)
> 
> That is these two commits have not been removed.

They had: please pay attention to the names of the "references" taken in
parentheses - your two "extra" commits are at the tips of the branches
named origin/copyright and origin/copy, while origin/master point at the
correct commit - exactly that you have told remote Git to update its "master"
branch with.

Now please note that there are more info attached to the commit c945bf there:

 * HEAD -> master tells you that c945bf is the commit currently checked out
   (HEAD always points at the commit which you're working on).
   And the arrow tells you which local branch will be updated should you
   record a new commit.

   So this bit tells you that you have the local branch "master" checked out,
   and it has the expected commit at its tip - just what you have requested
   by executing that `git push` command above.

 * origin/HEAD is of less interest but let's describe it, too.
   The HEAD in a remote repository points at a branch which will be "the
   default" one in the repositories which are created when that remote repo
   is cloned (the books usually say it's "master" but in fact it's what HEAD
   points at).

In other words, it's the usage of the "--all" command-line option which
tripped you: should you have examined just origin/master, you'd have seen that
everything is normal.
I'll try to expand on those "origin/" prefixes in a moment.

> Not sure how to proceed.

Well, at first, note that all is in green area now.
You might want to furthr adjust things a bit, if you want, but the "master"
branch in the remote repository has the state you shought for it to be in your
initial mail.

So, let's look at those "origin/" prefixes.
As I've already said, when the user has configured in their local repository
one or more "named remote repositories" - and "origin" is one of such
reporisories; `git clone` creates it automatically, - Git starts to track the
state of the branches in these repositories. These branches are created in
what you can call "a namespace", with the namespace being the name of the
remote. So git tracks the state of the branch "master" in the remote known as
"origin" as "origin/master" in your local repository. These branches are called
"remote branches" (which is a bit unfortunate because they are maintained in a
local repository).
Each time an operation like `git push` or `git fetch` involving that remote
repo is executed, Git updates the state of one or more remote branches for
that repository (which exactly - depends on the specifics of each particular
operation, let's not dig deeper right now).

As you can see, when you have cloned your updated repository, Git created in
it a set of remote branches which follow the state of the branches in the
origin (remote) repository. Judging from the output of `git log --all`,
the remote repository has at least three branches: master, copy and copyright,
and that why `git log` decorates their tip commits in its output with the
names of the remote branches.
Basically this means that the master branch in the remote repository points at
the now-correct commit, but the branches copy and copyright - are not.

You could have verified that without cloning - merely by running

  git fetch origin

or

  git fetch --prune origin

(which is the same but would also delete those remote braches which have been
following the branches in the remote repo which have been deleted since the
last check), and then inspecting the state of origin/master.

As to what to do now - it depends on what your end goals are.

First, as 

Re: [git-users] how to remove two commits from a remote server

2021-11-26 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

> On Fri, Nov 26, 2021 at 07:02:06PM +0100, Uwe Brauer wrote:
>> A couple of minutes ago I screwed up a repository at sourceforge.
>> 
>> In my machine it reads 
>> 
>> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
>> origin/copy)
>> | Author: Uwe Brauer 
>> | Date:   Thu Nov 25 10:43:56 2021 +0100
>> |
>> | Add patches to my new branch
>> |
>> | --HG--
>> | branch : copyright
>> |
>> * commit 66380013003549a6851d4e110b29a5a439e05609
>> | Author: Uwe Brauer 
>> | Date:   Mon Nov 22 21:51:13 2021 +0100
>> |
>> | Add patches to a special, named branch!
>> |
>> | --HG--
>> | branch : copyright
>> |
>> * commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (origin/master, 
>> origin/HEAD)
>> | Author: Uwe Brauer 
>> | Date:   Mon Nov 22 09:33:48 2021 +0100
>> |
>> | Correct a silly typo in company-matlab-shell.el
>> |
>> | * company-matlab-shell.el: 677 correct a silly typo: Auctex should be 
>> Matlab
>> 
>> 
>> The first two commits I should have pushed.

> What are the first two? The two at the bottom - so that these are c945bf50251
> and 66380013003?

Thanks for you answer. I only saw it by now. I mispelled the commits.

I meant I should *NOT* have pushed 

>> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
>> origin/copy)
>> | Author: Uwe Brauer 
>> | Date:   Thu Nov 25 10:43:56 2021 +0100
>> |
>> | Add patches to my new branch
>> |
>> | --HG--
>> | branch : copyright
>> |
>> * commit 66380013003549a6851d4e110b29a5a439e05609
>> | Author: Uwe Brauer 
>> | Date:   Mon Nov 22 21:51:13 2021 +0100
>> |
>> | Add patches to a special, named branch!
>> |
>> | --HG--
>> | branch : copyright
>> |


In other words I need to remove 

>> commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
>> origin/copy)
>> * commit 66380013003549a6851d4e110b29a5a439e05609


> If yes, then it's simple: do

>   $ git push -f origin 66380013003:master

By that logic I should run 



 git push -f origin  c945bf50251150e0d4ad7ee751c7e9615cb4b3e8:master


But this seemed not to have helped. 

When I clone the repository I see in a different local directory again
adn run 

 git log --all 

@commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, origin/copy)
| Author: Uwe Brauer 
| Date:   Thu Nov 25 10:43:56 2021 +0100
|
| Add patches to my new branch
|
| --HG--
| branch : copyright
|
* commit 66380013003549a6851d4e110b29a5a439e05609
| Author: Uwe Brauer 
| Date:   Mon Nov 22 21:51:13 2021 +0100
|
| Add patches to a special, named branch!
|
| --HG--
| branch : copyright
|
* commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (HEAD -> master, 
origin/master, origin/HEAD)

That is these two commits have not been removed.

Not sure how to proceed.

Thanks 

Uwe 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87mtlq37iq.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how to remove two commits from a remote server

2021-11-26 Thread Konstantin Khomoutov
On Fri, Nov 26, 2021 at 07:02:06PM +0100, Uwe Brauer wrote:

> A couple of minutes ago I screwed up a repository at sourceforge.
> 
> In my machine it reads 
> 
>  commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, 
> origin/copy)
> | Author: Uwe Brauer 
> | Date:   Thu Nov 25 10:43:56 2021 +0100
> |
> | Add patches to my new branch
> |
> | --HG--
> | branch : copyright
> |
> * commit 66380013003549a6851d4e110b29a5a439e05609
> | Author: Uwe Brauer 
> | Date:   Mon Nov 22 21:51:13 2021 +0100
> |
> | Add patches to a special, named branch!
> |
> | --HG--
> | branch : copyright
> |
> * commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (origin/master, origin/HEAD)
> | Author: Uwe Brauer 
> | Date:   Mon Nov 22 09:33:48 2021 +0100
> |
> | Correct a silly typo in company-matlab-shell.el
> |
> | * company-matlab-shell.el: 677 correct a silly typo: Auctex should be 
> Matlab
> 
> 
> The first two commits I should have pushed.

What are the first two? The two at the bottom - so that these are c945bf50251
and 66380013003?

If yes, then it's simple: do

  $ git push -f origin 66380013003:master

which means telling remote Git to make its "master" branch point at commit
66380013003; "-f" tells it to ignore that "non-fast-forward" condition.
IoW the specification WITH:WHAT tells remote Git to update WHAT with WITH.

If pushing still fails, it means that SF might have some (non-standard)
"protection" of the branch "master". I'd then checked the project's settings.

> I read in 
> https://stackoverflow.com/questions/3293531/how-to-permanently-remove-few-commits-from-remote-branch
> 
> I should run 
> 
>  git reset --hard c945b^

I'm not quite sure what this would achieve: it basically asks the local Git
to make the currently checked out branch to point at the first parent of the
commit c945bf50 -  throwing away what was committed on top (these commits
could be easily recovered, just in case).
>From the beginning of your message I would say this is not what is needed.

>  git push --force
> 
> But I receive then
> 
> git push --force
> Warning: Permanently added 'git.code.sf.net,216.105.38.16' (ECDSA) to the 
> list of known hosts.
> Total 0 (delta 0), reused 0 (delta 0)
> remote: error: denying non-fast-forward refs/heads/master (you should pull 
> first)
> To git+ssh://o...@git.code.sf.net/p/matlab-emacs/src
>  ! [remote rejected] master -> master (non-fast-forward)
> error: failed to push some refs to
> 'git+ssh://o...@git.code.sf.net/p/matlab-emacs/src'
> 
> I still hope I can repair that mess before anybody notes...
> 
> Any help would be strongly appreciated. 

Looks indeed like some sort of protection.
Unfortunately, it's been a while since I used SF as a developer so I cannot
tell for sure. [1] suggests SF does not have this feature, so please try what
I've suggested above (but please verify you select a correct commit to become
the tip commit of the remote "master" branch).

1. https://sourceforge.net/p/forge/feature-requests/634/

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20211126192209.ty2ilbkdbv6hghu2%40carbon.


[git-users] how to remove two commits from a remote server

2021-11-26 Thread Uwe Brauer



Hi

A couple of minutes ago I screwed up a repository at sourceforge.

In my machine it reads 


 commit 89346f81fef27286bd3fb1ed3ddc94a6f3fb560d (origin/copyright, origin/copy)
| Author: Uwe Brauer 
| Date:   Thu Nov 25 10:43:56 2021 +0100
|
| Add patches to my new branch
|
| --HG--
| branch : copyright
|
* commit 66380013003549a6851d4e110b29a5a439e05609
| Author: Uwe Brauer 
| Date:   Mon Nov 22 21:51:13 2021 +0100
|
| Add patches to a special, named branch!
|
| --HG--
| branch : copyright
|
* commit c945bf50251150e0d4ad7ee751c7e9615cb4b3e8 (origin/master, origin/HEAD)
| Author: Uwe Brauer 
| Date:   Mon Nov 22 09:33:48 2021 +0100
|
| Correct a silly typo in company-matlab-shell.el
|
| * company-matlab-shell.el: 677 correct a silly typo: Auctex should be 
Matlab


The first two commits I should have pushed.

I read in 
https://stackoverflow.com/questions/3293531/how-to-permanently-remove-few-commits-from-remote-branch

I should run 

 git reset --hard c945b^

 git push --force

But I receive then

git push --force
Warning: Permanently added 'git.code.sf.net,216.105.38.16' (ECDSA) to the list 
of known hosts.
Total 0 (delta 0), reused 0 (delta 0)
remote: error: denying non-fast-forward refs/heads/master (you should pull 
first)
To git+ssh://o...@git.code.sf.net/p/matlab-emacs/src
 ! [remote rejected] master -> master (non-fast-forward)
error: failed to push some refs to
'git+ssh://o...@git.code.sf.net/p/matlab-emacs/src'

I still hope I can repair that mess before anybody notes...

Any help would be strongly appreciated. 

Regards

Uwe Brauer 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87zgpq3ie9.fsf%40mat.ucm.es.


Re: [git-users] how *not* to push a certain branch but all others yes

2021-10-09 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

> On Thu, Oct 07, 2021 at 05:51:02PM +0200, Uwe Brauer wrote:
> [...]
>>> What command are you currently using to push "all main branches" or had you
>>> also implicitly asked how to do that?

>> No, I thought either 
>> 
>> git push 
>> 
>> Or 
>> 
>> git push --all 
>> 
>> Does this
>> 
>>> The full form of the `git push` command is
>> 
>>> $ git push   [ ...]
> [...]
>> >   $ git push origin 'refs/heads/pub/*:refs/heads/*'
> [...]
>>> The inconvenience is that you need to remember to create your local branches
>>> using that convention (and rename current branches - which is easy to do by
>>> using the `git branch -M` command).

>> I admit I am confused: I thought I should use the same name as in
>> remote, so master should be master and not pub_master
>> 
>> Most likely there is something fundamental I don't understand.

> I think it's just your mindset: to assume the names of the branches should 
> match is a thought which comes naturally, I would admit. But in reality Git 
> maintans a rather asymmetrical model when it comes to communicating with 
> remote repositories, and this requires certain getting into. I'll try to put 
> things into som perspective for you.

> First, in this age and time we're really accustomed to the workflow when you 
> clone some centrally-hosted repository and start pushing your work to it and 
> fetching the work done by others from it. Moreover, when it comes to creating 
> a repository for brand new object, people sort of automatically reach for one 
> or another Git hosting solution - it could be Github, Bitbucket etc for F/OSS 
> or private projects or, say, an on-premises corporate GitLab instance - to 
> first create an empty (or pre-populated from some template) repository 
> through the UI offerred by that solution, and that repository is - again - 
> subsequently cloned locally by those who intend to work on the project. In 
> other words, typically you end up cloning some repo in any case, and this 
> instills some warped mindset which makes you think that there is always some 
> main, reference, blueprint, master repository everyone sends their work to - 
> just like there was at the times of centralized VCS systems such as 
> Subversion, VSS etc.

Well this of course is true, I noted that with collaborators of me having this 
problem. However, as I have to admit, I am a regular mercurial user, which is a 
distributed VC as well and in some sense with an orthogonal approach towards 
implementation
(for example git log shows the current branch, and git log --all shows all 
branches, while hg log shows all branches and hg log -b certain branches etc 
etc).


However as things are I have to pull and push to git repositories from time to 
time, which I usually do with the hg-git plugin, however as good as the plugin 
is, it has its limitation, for example 
merging (git allows you to merge branches explicitly with the non-fast-forward 
option, which I prefer) of course hg itself has this feature but the hg-git 
plugin, still, does not convert that well, and that is why that from time to 
time I have to use git itself.

Now almost all the features you describe below work in mercurial, I mean having 
configured  pull and push to a bunch of different repositories, however, 
although I do this, I am extremely cautious with such operation since it easily 
can mess up things.


> But this is not really the case. Any Git repository is completely 
> self-sufficient (modulo some advanced black-magic facilities such as 
[Snip]...

> OK, so all this brings us to the model implemented by Git, and it has the 
> following properties:

> * Your local branches are truly yours, they are never updated automatically > 
> when you fetch from remote repositories. > Your local repository is 
> completely free-standing and self-sufficient.

>  * If you have named remotes - such as that well-known "origin", - fetching 
> from such remote will automatically create and maintain so-called "remote 
> branches" (the terminology is not too good, I know) which are "namespaced" to 
> separate them from your local branches.

>This makes it possible to properly manage such branches - for instance, 
> "master" fetched from "origin" ends up being remotes/origin/master in your 
> local repo and "master" fetched from "joes" becomes remotes/joes/master. Note 
> that this still have nothing to do with your local branch "master".

>  * Only you decide what local branches you update with which data fetched 
> from the remotes, and which local branches you push to which remote branches. 
> Git sometimes helps you with setting such relations in a sensible way - for 
> instance, when you `git clone` a repository, a configuration entry is added 
> to the clone making plain `git clone origin` force-update all the remoteer  
> branches tracking that remote repository in your local repo. But this setting 
> can be removed or changed at will.

> So all this leads us 

Re: [git-users] how *not* to push a certain branch but all others yes

2021-10-08 Thread Konstantin Khomoutov
On Thu, Oct 07, 2021 at 05:51:02PM +0200, Uwe Brauer wrote:

[...]
>> What command are you currently using to push "all main branches" or had you
>> also implicitly asked how to do that?

> No, I thought either 
> 
>  git push 
> 
> Or 
> 
> git push --all 
> 
> Does this
> 
>> The full form of the `git push` command is
> 
>>   $ git push   [ ...]
[...]
> >   $ git push origin 'refs/heads/pub/*:refs/heads/*'
[...]
>> The inconvenience is that you need to remember to create your local branches
>> using that convention (and rename current branches - which is easy to do by
>> using the `git branch -M` command).

> I admit I am confused: I thought I should use the same name as in
> remote, so master should be master and not pub_master
> 
> Most likely there is something fundamental I don't understand.

I think it's just your mindset: to assume the names of the branches should
match is a thought which comes naturally, I would admit. But in reality Git
maintans a rather asymmetrical model when it comes to communicating with
remote repositories, and this requires certain getting into.
I'll try to put things into som perspective for you.

I think the root cause of users not "getting" the asymmetry existing in
working with remote repositories is that they:

 * Begin considering the whole model starting at the central, rendez-vouz,
   repository - basically perceiving it as _the_ repository, while all the
   others - which are local clones of that central one, done by the
   developers - being its satellites, "downstreams".

 * Do not put much thought into the fact a Git repository is not bound
   to communicate with a single remote, and moreover - even with multiple
   remotes maintaining the same project.

Let's consider these things more closely.

First, in this age and time we're really accustomed to the workflow when you
clone some centrally-hosted repository and start pushing your work to it and
fetching the work done by others from it. Moreover, when it comes to creating
a repository for brand new object, people sort of automatically reach for one
or another Git hosting solution - it could be Github, Bitbucket etc for F/OSS
or private projects or, say, an on-premises corporate GitLab instance - to
first create an empty (or pre-populated from some template) repository through
the UI offerred by that solution, and that repository is - again -
subsequently cloned locally by those who intend to work on the project.
In other words, typically you end up cloning some repo in any case, and this
instills some warped mindset which makes you think that there is always some
main, reference, blueprint, master repository everyone sends their work to -
just like there was at the times of centralized VCS systems such as
Subversion, VSS etc.

But this is not really the case. Any Git repository is completely
self-sufficient (modulo some advanced black-magic facilities such as making
use of objects of another repository, but let's not digress) and
free-standing. It's perfectly possible to create and use locally a Git
repository which will never ever communicate with any remote repository.
Of course, when you run `git init` locally you end up with a repository with
these exact properties: it does not yet know about any remotes, and will
happily live without this knowledge.
Still, at any point in time, it's possible to teach a local repository about a
remote repository and start working with it.

Second, you can freely fetch objects from _any_ techincally accessible Git
repository into any local Git repository, and the same holds true for pushing.
And I really mean it: it's perfectly possible to fetch a branch from a Linus
Torvalds' Linux repository into your local repository containing your weekend
toy project. There are absolutely no restrictions here: Git repositories do
not somehow "know" which project's data they maintain - there's no
"identifier" which is checked when two instances of Git exchange data between
two Git repositories.

>From this, naturally comes the possibility to have any number of remote
repositories configured in a given local Git repository; and these
repositories - again - need not to maintain logically the same project.
The fact `git clone` automatically configures a single remote named "origin"
and pointing back to the repository which is cloned is just a useful feature
which is totally not required.
And to add to this, you do not even need to configure a remote repository to
fetch data from it or push data to it - `git fetch` and `git push` are
perfectly able to operate on URLs. A useful mind exercise based on this fact:
when you do

  $ git fetch https://github.com/torvalds/linux i915-bug-fix

what branch should Git create and/or update in your local clone?

I hope, a certain pucture should be emerging in your mind for now ;-)
A branch named "master" or "feature" or whatever in any given repository might
or might not have some relation to a same-named branch in your local
repository. Moreover, 

Re: [git-users] how *not* to push a certain branch but all others yes

2021-10-07 Thread Philip Oakley


On 07/10/2021 16:51, Uwe Brauer wrote:
>> The inconvenience is that you need to remember to create your local branches
>> using that convention (and rename current branches - which is easy to do by
>> using the `git branch -M` command).
> I admit I am confused: I thought I should use the same name as in
> remote, so master should be master and not pub_master
>
> Most likely there is something fundamental I don't understand.
Yes, it's easy to be confused.

There is NO requirement that the names match.

There is no requirement that you even have a local branch that 'tracks'
(is a duplicate of) a remote branch you are interested in
- This one is really hard to grasp for newer users who weren't there
when 'remotes' were invented. You simply, already, have a branch
`remote/branch` that is your own local copy of that truly remote
server's branch, and you can use that name when you start your feature
branch.

Like wise, you can use that separation of naming to distinguish your
'keep-local' branches, from your 'happy-to-publish' branches.

Philip
Git, juggling chainsaws while running in flip-flops ;-)


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/77d45a5e-658a-4813-d934-d14e434e26a0%40iee.email.


Re: [git-users] how *not* to push a certain branch but all others yes

2021-10-07 Thread Uwe Brauer
>>> "KK" == Konstantin Khomoutov  writes:

Hi 

Thanks for your detailed answer
> On Wed, Oct 06, 2021 at 03:13:11PM +0200, Uwe Brauer wrote:
>> I am facing the following situation, a repository I contribute to, has
>> at least 3 main branches (2 besides master/main).
>> 
>> Now I sometimes create branch for my own for some fix etc, but I don't
>> want to push that branch.
>> 
>> So if you did some changes in the other branches, I would like to push
>> them but not my private one.
>> 
>> I know who to push certain branches, but I don't know who to exclude
>> certain branches from the push (in mercurial I do this by a concept
>> called phases, but this does not exist in git), so any change to do this
>> in git?

> What command are you currently using to push "all main branches" or had you
> also implicitly asked how to do that?

No, I thought either 

 git push 

Or 

git push --all 

Does this

> The full form of the `git push` command is

>   $ git push   [ ...]

> "The refspec" tells Git what remote objects - branches and tags - to update
> with what local objects; the details are in the "gitrevisions" manual page -
> you can run `git help revisions` to read it.

> Now a command to push all local branches to update same-named branches in the
> remote repository is this:

>   $ git push  'refs/heads/*:refs/heads/*'

> That "refs/heads/" can be thought of as a namespace containing all the
> branches (and you can use your file browser of choice to explore the contents
> of the ".git" directory of your local clone - you'll find there that "refs"
> directory with the "heads" subdirectory in it, and there will be a set of
> files representing your local branches).

> So if we need to differentiate between "public" and "private" local branches,
> a way to achieve this would be to make a habit to name all "public" branches
> with some fixed prefix — say, "pub". Then, you could push all such branches in
> one go by running

>   $ git push origin 'refs/heads/pub/*:refs/heads/*'

> and even add an alias like

>   $ git config --global --add alias.publish 'push origin 
> refs/heads/pub/*:refs/heads/*'

> to be used like

>   $ git publish

> The inconvenience is that you need to remember to create your local branches
> using that convention (and rename current branches - which is easy to do by
> using the `git branch -M` command).


I admit I am confused: I thought I should use the same name as in
remote, so master should be master and not pub_master

Most likely there is something fundamental I don't understand.

Regards

Uwe Brauer 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87ily87s0p.fsf%40mat.ucm.es.


smime.p7s
Description: S/MIME cryptographic signature


Re: [git-users] how *not* to push a certain branch but all others yes

2021-10-06 Thread Konstantin Khomoutov
On Wed, Oct 06, 2021 at 03:13:11PM +0200, Uwe Brauer wrote:

> I am facing the following situation, a repository I contribute to, has
> at least 3 main branches (2 besides master/main).
> 
> Now I sometimes create branch for my own for some fix etc, but I don't
> want to push that branch.
> 
> So if you did some changes in the other branches, I would like to push
> them but not my private one.
> 
> I know who to push certain branches, but I don't know who to exclude
> certain branches from the push (in mercurial I do this by a concept
> called phases, but this does not exist in git), so any change to do this
> in git?

What command are you currently using to push "all main branches" or had you
also implicitly asked how to do that?

The full form of the `git push` command is

  $ git push   [ ...]

"The refspec" tells Git what remote objects - branches and tags - to update
with what local objects; the details are in the "gitrevisions" manual page -
you can run `git help revisions` to read it.

Now a command to push all local branches to update same-named branches in the
remote repository is this:

  $ git push  'refs/heads/*:refs/heads/*'

That "refs/heads/" can be thought of as a namespace containing all the
branches (and you can use your file browser of choice to explore the contents
of the ".git" directory of your local clone - you'll find there that "refs"
directory with the "heads" subdirectory in it, and there will be a set of
files representing your local branches).

So if we need to differentiate between "public" and "private" local branches,
a way to achieve this would be to make a habit to name all "public" branches
with some fixed prefix — say, "pub". Then, you could push all such branches in
one go by running

  $ git push origin 'refs/heads/pub/*:refs/heads/*'

and even add an alias like

  $ git config --global --add alias.publish 'push origin 
refs/heads/pub/*:refs/heads/*'

to be used like

  $ git publish

The inconvenience is that you need to remember to create your local branches
using that convention (and rename current branches - which is easy to do by
using the `git branch -M` command).

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20211006151604.4ilyswvvdzzabska%40carbon.


[git-users] how *not* to push a certain branch but all others yes

2021-10-06 Thread Uwe Brauer


Hi

I am facing the following situation, a repository I contribute to, has
at least 3 main branches (2 besides master/main).

Now I sometimes create branch for my own for some fix etc, but I don't
want to push that branch.

So if you did some changes in the other branches, I would like to push
them but not my private one.

I know who to push certain branches, but I don't know who to exclude
certain branches from the push (in mercurial I do this by a concept
called phases, but this does not exist in git), so any change to do this
in git?

Regards

Uwe Brauer 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87r1cyb8k8.fsf%40mat.ucm.es.


[git-users] How pack keep files are generated.?

2021-09-30 Thread David Charles T M
Hi Folks,

In one of our git repo, even after running multiple GC/repack, repo pack 
count is not getting reduced to single digit. When we checked inside repo 
objects pack folder, we could see multipe pack-SHA.keep files created and 
those packs related with this keep files are not getting repacked. We would 
like to understand how this keep files are getting generated inside pack 
folder.? What is the safe way to repack the repo to single pack.?

Regards,
Challs

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/96194634-2342-4b8d-b6c6-565d0727ab57n%40googlegroups.com.


[git-users] How to configure smtp credentials helper

2021-09-02 Thread Chris Waldon
Hey all,

I've been spending a lot of time lately using git send-email to send 
patchsets to mailing lists, and I'm super tired of supplying my SMTP 
password each time. However, I cannot seem to figure out how to configure a 
git credential helper for SMTP. No matter what syntax I try in my 
gitconfig, it appears to be ignored.

For instance:

[sendemail]
smtpserver = smtp.gmail.com
smtpuser = christopher.waldon@gmail.com
smtpencryption = tls
smtpserverport = 587
annotate = yes
[credential "smtp://smtp.gmail.com"]
helper = "!/usr/bin/pass smtp/christopher.waldon@gmail.com"

This is one permutation that I've tried. So far as I can tell, the helper 
is never invoked, so I assume that the URL is failing to match. I'm not 
sure how/why though.

Does anyone have a working SMTP credential helper configuration they can 
share with me?

Cheers,
Chris

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/7a4b8dd9-6312-4f25-96f3-98b6bab65924n%40googlegroups.com.


Re: [git-users] how to find newly added strings in the diff?

2021-08-16 Thread Tassilo Horn
Konstantin Khomoutov  writes:

> Here, I have interpreted the OP's question as specifically asking
> about what `git diff` outputs, and it generates the set of differences
> between the index and the work tree - there is no commit at that
> stage.
>
> Another thing to consider is that the pickaxe looks for a _particular_
> string: that is, the user knows what they're looking for up front, and
> IIUC the OP's question was specifically about _detecting_ the set of
> strings which were added in the work tree

After reading the question again, I think you are right in your
interpretation. :-)

Bye,
Tassilo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87mtphkt20.fsf%40gnu.org.


Re: [git-users] how to find newly added strings in the diff?

2021-08-16 Thread Konstantin Khomoutov
On Mon, Aug 16, 2021 at 07:05:11AM +0200, Tassilo Horn wrote:

>>> I am trying to figure a way to find the newly added *strings* in the
>>> commit diff,.
>>> 
>>> If I do a "git diff" I get all the changes which included newly added
>>> strings, modified strings as-well made in the commit, I only want the
>>> newly added strings(not files) in that commit,is there a way this can
>>> be achieved?
> >
> > I doubt it's possible simply because the very question - which strings
> > are new as opposed to changed - is unanswerable in general; at least
> > not without specifying a very narrow (and, I think, quite arbitrary)
> > set of restrictions to do such classification.
> 
> There is the git pickaxe, i.e.,
> 
>   git log -S FOOBAR
> 
> shows only those commits where the number of FOOBAR occurrences changed.
> That will include additions of FOOBAR, where the first found commit will
> probably be the initial introduction of FOOBAR.

A very interesting observation, indeed.
I use it all the time, but for its intended purpose - to search past existing
commits for those in which a particular string appeaed or disappeared.

Here, I have interpreted the OP's question as specifically asking about what
`git diff` outputs, and it generates the set of differences between the index
and the work tree - there is no commit at that stage.

Another thing to consider is that the pickaxe looks for a _particular_ string:
that is, the user knows what they're looking for up front, and IIUC the OP's
question was specifically about _detecting_ the set of strings which were
added in the work tree - compared to the state in the index. Hence pickaxe
looks quite similar in spirit but I'm not sure its machinery can be employed
to do what the OP needs.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20210816115635.azz7qnhklcv4als2%40carbon.


Re: [git-users] how to find newly added strings in the diff?

2021-08-16 Thread Philip Oakley
" a way to find the newly added *strings* in the commit diff, "

A thought from three steps back: Maybe a variant of the Word-diff (e.g. 
word moved display, etc) could be used. 

That is, if we redefine how the 'word' is detected, from the regular IFS 
split to being one that splits on paired single or double quotes, then it 
should be easy to use the existing machinery.

Obviously (in a line oriented diff) a "string" can't start a line without a 
quote mark, while regular word diff could start a line, but a string can 
end on an EOL, just like a word.

--
Philip

On Monday, August 16, 2021 at 6:09:06 AM UTC+1 Tassilo Horn wrote:

> Konstantin Khomoutov  writes:
>
> >> I am trying to figure a way to find the newly added *strings* in the
> >> commit diff,.
> >> 
> >> If I do a "git diff" I get all the changes which included newly added
> >> strings, modified strings as-well made in the commit, I only want the
> >> newly added strings(not files) in that commit,is there a way this can
> >> be achieved?
> >
> > I doubt it's possible simply because the very question - which strings
> > are new as opposed to changed - is unanswerable in general; at least
> > not without specifying a very narrow (and, I think, quite arbitrary)
> > set of restrictions to do such classification.
>
> There is the git pickaxe, i.e.,
>
> git log -S FOOBAR
>
> shows only those commits where the number of FOOBAR occurrences changed.
> That will include additions of FOOBAR, where the first found commit will
> probably be the initial introduction of FOOBAR.
>
> --8<---cut here---start->8---
> -S
> Look for differences that change the number of occurrences of the
> specified string (i.e. addition/deletion) in a file. Intended for
> the scripter’s use.
>
> It is useful when you’re looking for an exact block of code (like a
> struct), and want to know the history of that block since it first
> came into being: use the feature iteratively to feed the
> interesting block in the preimage back into -S, and keep going
> until you get the very first version of the block.
>
> Binary files are searched as well.
> --8<---cut here---end--->8---
>
> HTH,
> Tassilo
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/9c842962-cd26-483d-813c-16bb489c438an%40googlegroups.com.


Re: [git-users] how to find newly added strings in the diff?

2021-08-15 Thread Tassilo Horn
Konstantin Khomoutov  writes:

>> I am trying to figure a way to find the newly added *strings* in the
>> commit diff,.
>> 
>> If I do a "git diff" I get all the changes which included newly added
>> strings, modified strings as-well made in the commit, I only want the
>> newly added strings(not files) in that commit,is there a way this can
>> be achieved?
>
> I doubt it's possible simply because the very question - which strings
> are new as opposed to changed - is unanswerable in general; at least
> not without specifying a very narrow (and, I think, quite arbitrary)
> set of restrictions to do such classification.

There is the git pickaxe, i.e.,

  git log -S FOOBAR

shows only those commits where the number of FOOBAR occurrences changed.
That will include additions of FOOBAR, where the first found commit will
probably be the initial introduction of FOOBAR.

--8<---cut here---start->8---
   -S
   Look for differences that change the number of occurrences of the
   specified string (i.e. addition/deletion) in a file. Intended for
   the scripter’s use.

   It is useful when you’re looking for an exact block of code (like a
   struct), and want to know the history of that block since it first
   came into being: use the feature iteratively to feed the
   interesting block in the preimage back into -S, and keep going
   until you get the very first version of the block.

   Binary files are searched as well.
--8<---cut here---end--->8---

HTH,
Tassilo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/875yw6f02h.fsf%40gnu.org.


Re: [git-users] how to find newly added strings in the diff?

2021-08-15 Thread Konstantin Khomoutov
On Thu, Aug 12, 2021 at 12:42:17PM -0700, William wrote:

> I am trying to figure a way to find the newly added *strings* in the commit 
> diff,.
> 
> If I do a "git diff" I get all the changes which included newly added 
> strings, modified strings as-well made in the commit, I only want the newly 
> added strings(not files) in that commit,is there a way this can be achieved?

I doubt it's possible simply because the very question - which strings are new
as opposed to changed - is unanswerable in general; at least not without
specifying a very narrow (and, I think, quite arbitrary) set of restrictions
to do such classification.

The only workable solution I can think of is programming and then using -
via the "Git attributes" mechanism - a custom "diff driver" [1] which would
implement the algorythm for finding "newly added" strings.

One more thought, though.
You might try playing with a poor man's approach to detecting "newly added"
strings by searching through a stock diff Git generates by searching for
such blocks of text starting with the '+' character, which are not immediately
preceded by a line starting with the '-' character.  In other words,

  aaa
  bbb
 + ccc
 + ddd
  eee

can be considered to mean the lines "ccc" and "ddd" are "newly added", while

  aaa
  bbb
 - ccc
 + ddd
 + eee
  fff

can be considered to mean the lines "ddd" and "eee" are replacing the line
"ccc" - and are, hence, not "newly added".

Still, as you can see, the string "eee" in the last example can be considered
or not considered as newly added; that's what I was talking about in the
opening part of my answer.

 1. https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20210815122957.6ug5clwts5xz4qiq%40carbon.


[git-users] how to find newly added strings in the diff?

2021-08-12 Thread William
Hello all

I am trying to figure a way to find the newly added *strings* in the commit 
diff,.

If I do a "git diff" I get all the changes which included newly added 
strings, modified strings as-well made in the commit, I only want the newly 
added strings(not files) in that commit,is there a way this can be achieved?

Thanks

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/aaeb4e2a-7be8-4038-b251-1fcf4520e871n%40googlegroups.com.


Re: [git-users] How can I contact the author of VSCode extension "Bracket Pair Colorizer 2"?

2021-06-10 Thread Magnus Therning


Levan Katsadze  writes:

I want to contact the author of VSCode extension "Bracket Pair 
Colorizer

2", I have used the source code of BPC2 into my VSCode extension
"Blockman". Sometimes it does not work because it has conflict 
with BPC2,

so I want some help how to fix this conflict.


I would be VERY surprised if you reach the author of a VSCode 
extension

on this list!

This list is for _git users_, not for GitHub or its users, and not 
for

VSCode extension authors.

/M

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

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/877dj1ladd.fsf%40therning.org.


signature.asc
Description: PGP signature


Re: [git-users] How to fill @author, @date tags etc. in header and source files automatically with git

2021-02-23 Thread Tassilo Horn
csgil...@gmail.com  writes:

Hi!

> I am new to git. I have C++ header and source files with the following tags:
>
> @author
> @date
> @history
> @file
>
> How can these be filled in automatically with git like SVN fills these
> in?

See: 
https://stackoverflow.com/questions/1792838/how-do-i-enable-the-ident-string-for-a-git-repository

HTH,
Tassilo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/87lfbewzn7.fsf%40gnu.org.


[git-users] How to fill @author, @date tags etc. in header and source files automatically with git

2021-02-22 Thread csgil...@gmail.com
Hi Group,

I am new to git. I have C++ header and source files with the following tags:

@author
@date
@history
@file

How can these be filled in automatically with git like SVN fills these in?

Kind Regards

CSGill

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/b0af594e-ce1b-437c-bed4-ef83c164318bn%40googlegroups.com.


Re: [git-users] how to get all blobs from remote server

2020-10-25 Thread Michael


On 2020-10-25, at 5:25 AM, Konstantin Khomoutov  wrote:

> Aren't you using Git in a way it wasn't supposed to be used? ;-)
> Git is indeed a content-addressable filesystem in its core

"In a way it wasn't supposed to be used" implies that there is a way it was 
supposed to be used. If there is such a way, I've never seen it documented.

Git, to me at least, seems like the assembly language / virtual machine for an 
immutable system of datablobs, that has a "file system" of sorts layered on top 
of that (well, more accurately, many many file systems that all share the same 
datablobs). At the lowest level, as long as one of the reachable filetrees has 
a reference to a datablob somewhere, then that datablob will not be garbage 
collected -- but if you disable the garbage collection system, or use a custom 
one, then arbitrary datablobs not even referenced in a git file tree can be 
stored in the packs.

Built on top of this, like the C language, is a version control system, that 
seems like the assembly language of VCS systems. For anything that you want to 
do, there's multiple ways to do it. Rules for how you set up a bunch of 
repositories for many developers to work together on a project are numerous, 
all different, and the procedures and best practices at one place might be 
different at another place,
depending on whether you have a "privileged publishing master" or not.
Depending on whether or not each person treats their own "master" as their own 
version, or if "master" is the shared current best version and everyone has 
their own forks off that.
Depending on whether or not you are set up for a triangle flow, and which 
version of triangle flow you use.
Depending on whether or not you do plain rebasing, or imerge-based rebase with 
history.
Depending on whether or not you use the "git flow" branching system, or some 
other branching system.
Depending on whether or not you do squashed merges.
Etc.

There are too many different "how do I use git as a VCS" options, and frankly, 
I've never seen a really good "best practices" that covers all the bases. Just 
that what you want to be able to do with git determines which of the many ways 
to do things you will do -- and if there is a "If this is your goal, then this 
is your setup" document that addresses the many different "this is what I want 
to be able to do", I haven't seen it.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/D6D994FB-DF20-49AB-AF19-4BD4C394D4FA%40gmail.com.


Re: [git-users] how to get all blobs from remote server

2020-10-25 Thread Philip Oakley
Hi skobo00,

I believe there is some work on something like this (accessing remote blobs 
& trees) for the --sparse and --partial clones, along with Microsoft's Git 
Virtual File System (I think it has a new, but similar, name) all of which 
are looking at the problem of very large repositories where cloning the 
whole thing is unwanted/undesired. 

Have a look at the Git mailing list archive, https://lore.kernel.org/git/, 
for those terms and for ` Derrick Stolee `who's done some of the 
contributions.

Hope that helps
Philip

On Sunday, October 25, 2020 at 12:25:46 PM UTC Konstantin Khomoutov wrote:

> On Thu, Oct 15, 2020 at 09:39:01PM -0700, 'skobo002 University of 
> Minnesota' via Git for human beings wrote:
>
> > I'm looking to see if there's a feature in any version of git to be able 
> to 
> > ask the server to list all blob ids for a particular commit. So far, 
> from 
> > what I've seen it doesn't look like this is possible. I know git has 
> `git 
> > ls-remote` which can list the commits IDs of remote references like 
> HEAD, 
> > or tags, or branches. But what I'd like to do is:
> > 
> > - list all remote commit ids
> > - list all blobs/trees that a commit points to
> > 
> > My questions are:
> > 1. is this possible currently? if so, how?
>
> I doubt it is possible: the "wire protocol" for Git was designed to 
> facilitate
> (minimal) transfer of _history_ data between the two repositories (in both
> directions), and since they key concept when operating on histories is
> commit - remember that a commit's name (its "hash") is cryptographically
> derived from its contents which includes the hashes of the tree object it
> references, and blobs and tree object that object references - and so on, 
> all
> the way down to the "leaf" blobs), - the protocol is about one side of the
> transfer telling "I have this history and want that history" and another 
> side
> calculating what's required to send to fill the gaps in the asker's
> repository.
>
> Still, the only definitive answer can be obtained from the docs on the
> protocol; you might want start with the files in [1], and protocol-v2.txt
> in particular.
>
> > 2. if not, is this something that would be desirable to be implemented 
> in 
> > git?
>
> I have no idea but to me the facility, as specified, does not appear to be 
> too
> useful: suppose you have a way in a protocol to ask what blobs a specific 
> tree
> objects has - what use is this for? I mean, the facility is too narrow to
> consider it as a way to query a remote repository for generic information -
> basically to do _that_ it would have sense to implement complete FTP-like
> protocol for "listing" the remote repository through all "dimensions" of 
> the
> data it contains. But then again, suppose you have such facility (it looks
> like a protocol actually orthoronal to what Git currently has but let's not
> digress), what real-world problem would it solve? An ability to download a
> particular SHA-1 named blob? But what use that would be? Aren't you using 
> Git
> in a way it wasn't supposed to be used? ;-)
> Git is indeed a content-addressable filesystem in its core, but it wasn't
> concieved as a remotely-accessible content-addressable filesystem, and if 
> you
> want one may be just look for a ready-made implementation of it?
>
> > If it's a desirable feature, I would be happy to work on it, but I want 
> to 
> > get a thumbs up first.
>
> That's not the right place to ask for a thumbs-up: you've posted to a list
> intended to help mere mortals with their day-to-day Git usage ;-)
> The development of Git happens elsewhere, please refer to [2].
>
> 1. https://github.com/git/git/blob/master/Documentation/technical/
> 2. 
> https://gist.github.com/tfnico/4441562#writing-an-email-to-the-developers-list
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/be61550e-8ae1-414b-87d5-20c4c6b0e607n%40googlegroups.com.


Re: [git-users] how to get all blobs from remote server

2020-10-25 Thread Konstantin Khomoutov
On Thu, Oct 15, 2020 at 09:39:01PM -0700, 'skobo002 University of Minnesota' 
via Git for human beings wrote:

> I'm looking to see if there's a feature in any version of git to be able to 
> ask the server to list all blob ids for a particular commit. So far, from 
> what I've seen it doesn't look like this is possible. I know git has `git 
> ls-remote` which can list the commits IDs of remote references like HEAD, 
> or tags, or branches. But what I'd like to do is:
> 
> - list all remote commit ids
> - list all blobs/trees that a commit points to
> 
> My questions are:
> 1. is this possible currently? if so, how?

I doubt it is possible: the "wire protocol" for Git was designed to facilitate
(minimal) transfer of _history_ data between the two repositories (in both
directions), and since they key concept when operating on histories is
commit - remember that a commit's name (its "hash") is cryptographically
derived from its contents which includes the hashes of the tree object it
references, and blobs and tree object that object references - and so on, all
the way down to the "leaf" blobs), - the protocol is about one side of the
transfer telling "I have this history and want that history" and another side
calculating what's required to send to fill the gaps in the asker's
repository.

Still, the only definitive answer can be obtained from the docs on the
protocol; you might want start with the files in [1], and protocol-v2.txt
in particular.

> 2. if not, is this something that would be desirable to be implemented in 
> git?

I have no idea but to me the facility, as specified, does not appear to be too
useful: suppose you have a way in a protocol to ask what blobs a specific tree
objects has - what use is this for? I mean, the facility is too narrow to
consider it as a way to query a remote repository for generic information -
basically to do _that_ it would have sense to implement complete FTP-like
protocol for "listing" the remote repository through all "dimensions" of the
data it contains. But then again, suppose you have such facility (it looks
like a protocol actually orthoronal to what Git currently has but let's not
digress), what real-world problem would it solve? An ability to download a
particular SHA-1 named blob? But what use that would be? Aren't you using Git
in a way it wasn't supposed to be used? ;-)
Git is indeed a content-addressable filesystem in its core, but it wasn't
concieved as a remotely-accessible content-addressable filesystem, and if you
want one may be just look for a ready-made implementation of it?

> If it's a desirable feature, I would be happy to work on it, but I want to 
> get a thumbs up first.

That's not the right place to ask for a thumbs-up: you've posted to a list
intended to help mere mortals with their day-to-day Git usage ;-)
The development of Git happens elsewhere, please refer to [2].

 1. https://github.com/git/git/blob/master/Documentation/technical/
 2. 
https://gist.github.com/tfnico/4441562#writing-an-email-to-the-developers-list
 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/20201025122538.vekdte2rwhvz46uk%40carbon.


[git-users] how to get all blobs from remote server

2020-10-15 Thread 'skobo002 University of Minnesota' via Git for human beings
I'm looking to see if there's a feature in any version of git to be able to 
ask the server to list all blob ids for a particular commit. So far, from 
what I've seen it doesn't look like this is possible. I know git has `git 
ls-remote` which can list the commits IDs of remote references like HEAD, 
or tags, or branches. But what I'd like to do is:

- list all remote commit ids
- list all blobs/trees that a commit points to

My questions are:
1. is this possible currently? if so, how?
2. if not, is this something that would be desirable to be implemented in 
git?

If it's a desirable feature, I would be happy to work on it, but I want to 
get a thumbs up first.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/bee90fdb-ce1b-4c28-a7f5-a5b914a1e367n%40googlegroups.com.


[git-users] How to add better copy detection to gitk?

2020-09-25 Thread Robert Pollak
Hello,

In command line Git, the show, diff and log commands have got the option 
--find-copies-harder.

Is there a way I can tell or modify gitk to use this, too? I need this from 
time to time, and my projects are small enough such that I don't care about 
the reduced performance.

(I don't want to craft the history to force copy detection 
 any more.)

I have also posted this on stackoverflow 
, but I hope to find a 
broader audience and maybe some shell scripting expert here.

Best regards,
Robert

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/b101e4ba-8685-4662-9ed9-64b10deba3e6n%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-06 Thread rhkramer
On Wednesday, August 05, 2020 07:43:53 PM SJW wrote:
> On Wednesday, 5 August 2020 at 23:15:49 UTC+10 rhkr...@gmail.com wrote:
> > Interesting puzzle ;-)
> > 
> > Do you create one file named feature.txt, or do you create a different
> > file for
> > each feature with a unique name?
> > 
> > (I'm trying to understand "all these text files" from below.)
> > 
> > One thing I'd consider is just having one file named feature.txt, or
> > notes.txt
> > and modify that as appropriate and commit it with each change.
> > 
> > Then when you checkout a feature branch, you get the notes (DB ALTER
> > statements) associated with that feature, and it stays associated with
> > that
> > feature branch.
> > 
> > You could choose another name for the text file, perhaps: db_alter.txt
> 
> I have a different file for each feature - problem is, when I merge the
> feature and delete the branch, the notes get merged so if I have 5 feature
> branchs, I end up with 5 rogue feature.txt files

I guess you mean you have a .txt file for each feature, each with a 
different name.

In retrospect (retrospect is easy ;-), not the way I'd do it.

I don't know how big your repository is and how hard / time consuming it would 
be to go back and rename each of those .txt files with the same name, 
and then, as discussed earlier, merge those files at the same time you merge 
the features.

(E.g., you probably don't need this, but to clarify: you might have a file sort 
of like a history file (probably in reverse chronological sequence?)>:

(e.g.) file features.txt

 Feature 




...

 Feature 




Now that you're in the present condition, I don't have another suggestion to 
offer.












Re: [git-users] How to track changes to db

2020-08-05 Thread SJW


On Thursday, 6 August 2020 at 06:59:28 UTC+10 Magnus Therning wrote:

>
> SJW  writes: 
>
> > I'm not sure I understand exactly what it is you are talling about 
>
> As I mentioned, I'm not sure I understand your question... anyway, it 
> might be worthwhile looking into migrations since it sounds like you're 
> doing a lot of manual changes to DB schemas and trying to keep track of 
> them. 
>

Example. I developed integration with a cloud storage service.  I created a 
txt file for this feature and in it contained:

1. Instructions on how to generate the API key required to communicate with 
the cloud server
2. The new database tables created in dev that need to be replicated in 
staging and production
3. Limitations of the integration that may need to be addressed in the 
future.
 

>
> Here's what looks like a decent introduction to database migrations: 
> https://rollout.io/blog/database-migration/ 
>
> I'm sure there's a library to do that in whatever language you are 
> comfortable with. Some examples: 
>
> - Python: https://pypi.org/project/yoyo-migrations/ 
> - Ruby: https://github.com/winebarrel/ridgepole 
> - Java: https://github.com/liquibase/liquibase 
> - Go: https://github.com/golang-migrate/migrate 
>
> and there are command line tools for it as well 
>
> - https://github.com/golang-migrate/migrate 
> - https://github.com/aphel-bilisim-hizmetleri/pg-migrator 
>
> /M 
>
> -- 
> Magnus Therning OpenPGP: 0x927912051716CE39 
> email: 
> twitter: magthe http://magnus.therning.org/ 
>
> Reality is that which, when you stop believing in it, doesn't go away. 
> — Philip K. Dick 
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/ef8ffcca-0e35-47aa-9fb9-fe7de0f28d75n%40googlegroups.com.


Re: [git-users] How to track changes to db

2020-08-05 Thread SJW


On Wednesday, 5 August 2020 at 23:15:49 UTC+10 rhkr...@gmail.com wrote:

> On Tuesday, August 04, 2020 10:34:59 PM SJW wrote: 
> > I am trying to find a good way to track changes to the db but havn't got 
> it 
> > down pat yet. 
> > 
> > What I am doing 
> > 
> > ``` 
> > git branch feature 
> > git checkout feature 
> > ``` 
> > 
> > modify code and add/modify database tables 
> > ... 
> > create a txt file called feature.txt and list changes. e.g. DB ALTER 
> > statements etc. that I need to apply to staging and production db's 
>
> Interesting puzzle ;-) 
>
> Do you create one file named feature.txt, or do you create a different 
> file for 
> each feature with a unique name? 
>
> (I'm trying to understand "all these text files" from below.) 
>
> One thing I'd consider is just having one file named feature.txt, or 
> notes.txt 
> and modify that as appropriate and commit it with each change. 
>
> Then when you checkout a feature branch, you get the notes (DB ALTER 
> statements) associated with that feature, and it stays associated with 
> that 
> feature branch. 
>
> You could choose another name for the text file, perhaps: db_alter.txt 
>
>  
I have a different file for each feature - problem is, when I merge the 
feature and delete the branch, the notes get merged so if I have 5 feature 
branchs, I end up with 5 rogue feature.txt files  

I started with just database.sql and I would export the structure on each 
environment and then just compare but when I started using git push, the 
compare became redundant  
 

>
> > ... 
> > 
> > ``` 
> > git add . 
> > git commit -m "Message" 
> > git checkout staging 
> > git merge feature 
> > git checkout master 
> > git merge feature 
> > ``` 
> > 
> > Problem I have is that I have all these txt files that are just notes so 
> I 
> > delete them but they keep reappearing ( because I merged them into 
> master 
> > and then create new branch etc. ) 
> > 
> > I found this was a bit annoying so I stopped adding and committing the 
> txt 
> > files but now I have these txt files sitting in the unstaged changes 
> area 
> > of all projects - not a great idea either. 
> > 
> > Any suggestions on how to better manage these notes and somehow ensure 
> they 
> > remain linked to each feature branch? 
> > 
> > Thanks 
>

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/dd9db861-ad67-4609-a9f3-7057cbc3afd1n%40googlegroups.com.


  1   2   3   4   5   6   7   8   9   >