janet-lang / jpm

Janet Project Manager
MIT License
68 stars 22 forks source link

Fix tags and add shallow fetching #30

Closed Jakski closed 2 years ago

Jakski commented 2 years ago
bakpakin commented 2 years ago

This breaks some other stuff - including setting the default branch back to master instead of whatever the repository owner marks as default. The simple thing here is to simply add a checkout step I believe, which I was trying to avoid. I guess we can remove the -b option as well as --single-branch

Jakski commented 2 years ago

init.defaultBranch=master only prevents warning about missing default branch. It doesn't affect git fetch. If repository owner marks different branch as a default, it will be reflected in remote HEAD ref and used by JPM, unless user overwrites tag in project.janet. @bakpakin Does it address problem, that you described?

EDIT: Without init.defaultBranch=master Git would print

hint: Using 'master' as the name for the initial branch. This default branch name                                      
hint: is subject to change. To configure the initial branch name to use in all                                         
hint: of your new repositories, which will suppress this warning, call:                                                
hint:                                                                                                                  
hint:   git config --global init.defaultBranch <name>                                                                  
hint:                                                                                                                  
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and                                                
hint: 'development'. The just-created branch can be renamed via this command:                                          
hint:                                                                                                                  
hint:   git branch -m <name>

making output less readable.

bakpakin commented 2 years ago

Ah, nice. Indeed, I tested with a repo that is now using main as the default branch and works as expected. Great, lgtm then.