Are svn usernames in authors file for git svn --authors-file case sensitive? - git-svn

I want to use git svn with --authors-file=authors-file.txt, with authors-file.txt:
joe1 = Joe User <user#example.com>
Joe1 = Joe User <user#example.com>
JOE1 = Joe User <user#example.com>
Is the svn username case sensitive regarding git svn --authors-file? Will it still work if I omit the different variants?

I'm actually going through this process at the moment, and can confirm that Git is case sensitive here even if the operatng system isn't. If you ommit those entries from you authors file then Git will fail with an author not defined error when attempting to clone from SVN.

Related

How to change the master username at git in WebStorm?

WebStorm tries to push my project to an account that does not exist anymore. How do I change it? I have already added the new account to WebStorm and it still tries pushing to the old account.
You can change it in Settings>Repositories.
Setting>General>Repository name>rename
The entry highlighted on the screenshot is the commit author. This information is written in the commit, and is not related to the account that is used to push the change.
Author is determined by git configuration. You can check and change it using CLI - git config user.name and git config user.email
To change the author of the commit in question you need to re-do the commit.
Make sure git user is correctly set in git config, then undo the commit, and commit changes again.
To push, WebStorm will authenticate using the account configured in Settings | Version Control | GitHub, or according to the ssh config if ssh access is used.

how to git clone via https with personal access token in private project gitlab

I want to git clone a private repository with two factor authentication on my mac, I already have a personal access token in my gitlab, and I'm trying to find the correct command to run on the vscode terminal.
omarfuentes#192 ~ % git clone https://gitlab.com/OmarLeonardo/frappe/proyectos/frappe-oms/frappe-server.git?personal_access_token=myaccesstoken
however the answer is:
zsh: no matches found: https://gitlab.com/OmarLeonardo/frappe/proyectos/frappe-oms/frappe-server.git?personal_access_token=myaccesstoken
If you are using a PAT (Personal Access Token) with the right scope, you should use:
git clone https://<my-user-id>:<my-token>#gitlab.com/<my-account>/<my-project-name>.git
# or
git clone https://oauth2:<my-token>#gitlab.com/<my-account>/<my-project-name>.git
That would avoid the need to URL encode your parameter.
To clarify, if you created your account with Google you can find your username in the URL to the repository. You can also see the name of your project there. So if your URL looks like the below:
https://gitlab.com/me1234567/myproject/-/tree/main
your final command would look like this:
git clone https://oauth2:my-personal-token-123#gitlab.com/me1234567/myproject.git
The User ID you see under the Gitlab Edit profile can not be used, nor your email address or the "username" you see under your avatar which starts with #

git svn command to get remote HEAD revision number

is there a git svn command that will tell me the HEAD revision on the svn remote repositiory before I perform a git svn fetch?
Use case (Since someone asked why I'd want to do this.)
I want to check if there has been a large number of commits to the remote repository before I start the fetch, so I know whether to do something else* before it finishes, or just sit staring at the console because it will be done quickly.
* something else = go and make a coffee
Git has a similar feature with git ls-remote.
git svn itself might, through git svn info <url>, which does an svn info (without -r/-revision option support though)
Try using it with the URL of the remote SVN repository.
If it does now work, try svn info <url> directly.

SVN change username

I found a lot of examples on how to change the username for specific revisions and so on.
But what I need is this:
I did a checkout with the authentication credentials of a workmate and need to change it to my credentials for future commits.
I cannot just checkout with my credentials due to the many changes that have been done already...
Anyone familiar with this?
You can change the user with
Subversion 1.6 and earlier:
svn switch --relocate protocol://currentUser#server/path protocol://newUser#server/path
Subversion 1.7 and later:
svn relocate protocol://currentUser#server/path protocol://newUser#server/path
To find out what protocol://currentUser#server/path is, run
svn info
in your working copy.
The easiest way to do this is to simply use the --username option on your next checkout or commit. For example:
svn commit --username newUser
or
svn co --username newUser
It will then be cached and will be used as the default username for future commands.
See also:
In Subversion can I be a user other than my login name?
I’ve had the exact same problem and found the solution in Where does SVN client store user authentication data?:
cd to ~/.subversion/auth/.
Do fgrep -l <yourworkmatesusernameORtheserverurl> */*.
Delete the file found.
The next operation on the repository will ask you again for username/password information.
(For Windows, the steps are analogous; the auth directory is in %APPDATA%\Subversion\).
Note that this will only work for SVN access schemes where the user name is part of the server login so it’s no use for repositories accessed using file://.
The command, that can be executed:
svn up --username newUsername
Works perfectly ;)
P.S. Just a hint: "--username" option can be executed on any "svn" command, not just update.
Go to Tortoise SVN --> Settings --> Saved Data.
There is an option to clear Authentication Data, click on the clear button, and it will allow you to select which connection you wanted to clear userid/pwd for.
After you do this, any checkout or update activity, it will reprompt for the userid and password.
If your protocol is http and you are using Subversion 1.7, you can switch the user at anytime by simply using the global --username option on any command.
When Ingo's method didn't work for me, this was what I found that worked.
for Win10 you should remove this folder and close/open your IDE
C:\Users\User\AppData\Roaming\Subversion\auth
, also in my projects no ".subversion" folders, only ".svn"
Also, for those who happened to realize too late, that they committed with the wrong credentials, the solution (after the fact) is to change the svn author of that revision: see this question
Basically the syntax is:
svn propset --revprop -r (revision_number) svn:author (new username)
Based on Ingo Kegel's solution I created a "small" bash script to change the username in all subfolders. Remember to:
Change <NEW_USERNAME> to the new username.
Change <OLD_USERNAME> to the current username (if you currently have no username set, simply remove <OLD_USERNAME>#).
In the code below the svn command is only printed out (not executed). To have the svn command executed, simply remove the echo and whitespace in front of it (just above popd).
for d in */ ; \
do echo $d ; pushd $d ; \
url=$(svn info | grep "URL: svn") ; \
url=$(echo ${url#"URL: "}) ; \
newurl=$(echo $url | sed "s/svn+ssh:\/\/<OLD_USERNAME>#/svn+ssh:\/\/<NEW_USERNAME>#/") ; \
echo "Old url: "$url ; echo "New url: "$newurl ; \
echo svn relocate $url $newurl ; \
popd ; \
done
Hope you find it useful!
I believe you could create you own branch (using your own credential) from the same trunk as your workmate's branch, merge from your workmate's branch to your working copy and then merge from your branch. All future commit should be marked as coming from you.
You could ask your colleague to create a patch, which will collapse all the changes that have been made into a single file that you can apply to your own check out. This will update all of your files appropriately and then you can revert the changes on his side and check yours in.
Tortoise on windows specific:
I attempted the above solution to no available. In my use case, the credentials where stored in the windows Credential Manager under the Windows Credential section and TortoiseSVN refused to change them by running the --username command.
You can edit the credentials by expanding the url for your repo and clicking edit.

Unable to create a new fossil repo, fossil beginner

I figured I would check out fossil for some small apps I have to complete. I am not new to DVCS as I have used CVS, subversion, mercurial, and git. After installing on my Mac (10.7), using homebrew, I am left with the following when attempting to run:
-> % fossil new ../FOSSIL/project.fossil
fossil: SQLITE_CONSTRAINT: abort at 20 in [INSERT INTO user(login,pw,cap,info) VALUES('developer','','dei','Dev');]: column login is not unique
fossil: column login is not unique
INSERT INTO user(login,pw,cap,info) VALUES('anonymous',hex(randomblob(8)),'hmncz','Anon');INSERT INTO user(login,pw,cap,info) VALUES('nobody','','gjor','Nobody');INSERT INTO user(login,pw,cap,info) VALUES('developer','','dei','Dev');INSERT INTO user(login,pw,cap,info) VALUES('reader','','kptw','Reader');
If you have recently updated your fossil executable, you might need to run "fossil all rebuild" to bring the repository schemas up to date.
I have attempted to run fossil init ../FOSSIL/project.fossil as well as fossil clone http://www.fossil-scm.org/ myclone.fossil which yields the same results as seen above.
I then tried fossil user list as it looks like fossil is having issues with logins and users, however fossil expects a repo argument. Searching for the default configuration (something like ~/.gitconfig with git) yielded no results.
I have also tried rm -rf ~/.fossil and re-running the above commands as well as using brew install sqlite to get the updated version (3.7.7 as of this writing), but neither seem to help.
What do I need to do in order to get fossil functioning properly?
Silly question... is your own username on the system "developer"? Since that would clash with the name of one of the auto-created users.
Try doing "fossil init -A admin (filename)" to use a different name ("admin" in my example) for the repository owner and see if it works.