Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Never use templates when managing git repos #6252

Merged
merged 1 commit into from
Nov 2, 2018

Conversation

alexcrichton
Copy link
Member

This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes #6240

@dwijnand
Copy link
Member

dwijnand commented Nov 2, 2018

Sounds good to me.

@bors: r+

@bors
Copy link
Contributor

bors commented Nov 2, 2018

📌 Commit a2b0611b2c40f4f8f6967ce9d1fdcd5120c05c06 has been approved by dwijnand

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows needs "C:/path/to/thing" style paths in gitconfig.

tests/testsuite/git.rs Show resolved Hide resolved
tests/testsuite/git.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows needs "C:/path/to/thing" style paths in gitconfig.

&format!(r#"
[init]
templatedir = {}
"#, git_project2.url().to_file_path().unwrap().display()).as_bytes(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"#, git_project2.url().to_file_path().unwrap().display()).as_bytes(),
"#,
git_project2
.url()
.to_file_path()
.unwrap()
.display()
.to_string()
.replace("\\", "/")
)
.as_bytes(),

@ehuss
Copy link
Contributor

ehuss commented Nov 2, 2018

I think I broke/confused github trying the new suggestion feature. Anyways, I was trying to say, the code needs to be changed to:

                templatedir = "{}"
            "#,
                git_project2
                    .url()
                    .to_file_path()
                    .unwrap()
                    .display()
                    .to_string()
                    .replace("\\", "/")
            )
            .as_bytes(),

For "C:/path/to/thing" for gitconfig style paths (double quotes and forward slashes).

@bors
Copy link
Contributor

bors commented Nov 2, 2018

⌛ Testing commit a2b0611b2c40f4f8f6967ce9d1fdcd5120c05c06 with merge 8e6b81c41c088d3bca9a6a2ba59ade2c815aaa4f...

@bors
Copy link
Contributor

bors commented Nov 2, 2018

💔 Test failed - status-appveyor

This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes rust-lang#6240
@alexcrichton
Copy link
Member Author

@bors: r=dwijnand

@bors
Copy link
Contributor

bors commented Nov 2, 2018

📌 Commit 2a4cdc6 has been approved by dwijnand

@bors
Copy link
Contributor

bors commented Nov 2, 2018

⌛ Testing commit 2a4cdc6 with merge 97046d0...

bors added a commit that referenced this pull request Nov 2, 2018
Never use templates when managing git repos

This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes #6240
@bors
Copy link
Contributor

bors commented Nov 2, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: dwijnand
Pushing 97046d0 to master...

@bors bors merged commit 2a4cdc6 into rust-lang:master Nov 2, 2018
@alexcrichton alexcrichton deleted the clone-and-templtes branch November 14, 2018 15:24
@ehuss ehuss added this to the 1.32.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"failed to create temporary file" when building a dependency from Git
4 participants