Skip to contentSkip to conversation

vfs.git regression fix

GIT PULL Al Viro 3 participants 7 messages Jan 15, 2016 – Jan 18, 2016 VFS

lore
Share & tools
lore

Al Viro

author maintainer
#0 lore raw

Fix for braino introduced in vfs.git#work.misc. Please, pull from
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git

Shortlog:
Borislav Petkov (1):
amdkfd: Copy from the proper user command pointer

Diffstat:

 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
#1 lore raw

Al,
_please_ learn to be more careful about your pull requests.

This one is garbage.

Why?

You ask me to pull from the wrong source. You ask me to pull from

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

but that is some random state from January 2014. Two years ago.

What you actually *meant* was apparently the "for-linus" branch, since that matches the shortlog and diffstat. But that's not what your pull request asked me to pull.

This is not the first time. You seem to either use buggy scripts, or do this (wrong) by hand. Please fix whatever it is, so that I don't have to go look or guess after I notice that I pulled crap.

Linus

Quoted 10 lines · Al Viro

Fix for braino introduced in vfs.git#work.misc. Please, pull from
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git

Shortlog:
Borislav Petkov (1):
amdkfd: Copy from the proper user command pointer

Diffstat:

 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
author maintainer
#2 lore raw
Quoted 13 lines · Linus Torvalds

Al,
_please_ learn to be more careful about your pull requests.

This one is garbage.

Why?

You ask me to pull from the wrong source. You ask me to pull from

git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

but that is some random state from January 2014. Two years ago.

Quoted 7 lines

What you actually *meant* was apparently the "for-linus" branch, since that matches the shortlog and diffstat. But that's not what your pull request asked me to pull.

This is not the first time. You seem to either use buggy scripts, or do this (wrong) by hand. Please fix whatever it is, so that I don't have to go look or guess after I notice that I pulled crap.

Buggy scripts, actually. The thing that generates them takes a branch name as argument; turns out that it (pretty much by accident) treats the missing argument as HEAD. Which tends to give reasonable diffstat and shortlog, so I hadn't spotted the missing check until now.

Fixed. BTW, is there any better way to get the current branch name than git branch |sed -ne '/\* /s///p'?

#3 lore raw
Quoted 5 lines · Al Viro

Buggy scripts, actually. The thing that generates them takes a branch name as argument; turns out that it (pretty much by accident) treats the missing argument as HEAD. Which tends to give reasonable diffstat and shortlog, so I hadn't spotted the missing check until now.

You could try "git request-pull". It _used_ to have somewhat similar issues, especially when the local branch had not made it to the remote point yet, but it should be good now. It actually warns if the remote name you give doesn't contain what the local branch contanis etc.

Quoted 2 lines

Fixed. BTW, is there any better way to get the current branch name than git branch |sed -ne '/\* /s///p'?

"git symbolic-ref HEAD" will show what HEAD points to. That's probably what you'd want..

Not that there is anything *wrong* with looking at "git branch" output, but that's really meant to be more human-readable than for scripting.

Linus

author maintainer
#4 lore raw
Quoted 11 lines · Linus Torvalds
Quoted 5 lines · Al Viro

Buggy scripts, actually. The thing that generates them takes a branch name as argument; turns out that it (pretty much by accident) treats the missing argument as HEAD. Which tends to give reasonable diffstat and shortlog, so I hadn't spotted the missing check until now.

You could try "git request-pull". It _used_ to have somewhat similar issues, especially when the local branch had not made it to the remote point yet, but it should be good now. It actually warns if the remote name you give doesn't contain what the local branch contanis etc.

Having checked how git request-pull reacts to missing branch argument... Very similar bug there - it gives stats for HEAD and URI with no branch name. Might've been fixed in later versions (it's 2.1.4 here - debian-stable)

FWIW, the main inconvenience with git request-pull is that it still needs s/[email protected]:/git:\/\/git.kernel.org/ postprocessing. It mimics the git push, but the remote you are pushing to probably won't be usable for pulling by others. Looks like it would be useful to have something like
pull_url = git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git
to go with
url = [email protected]:/pub/scm/linux/kernel/git/viro/vfs.git
in .git/config, settable by something in git remote. OTOH, it's possible to emulate by setting an extra remote and using git push vfs <...> for pushes, while doing git request-pull origin vfs-pull <...> for pull requests...

#5 lore raw
Quoted 2 lines · Al Viro

Having checked how git request-pull reacts to missing branch argument...

A missing branch name is the same as HEAD, so:

Quoted 2 lines

Very similar bug there - it gives stats for HEAD and URI with no branch name. Might've been fixed in later versions (it's 2.1.4 here - debian-stable)

If you say "no branch name", then it assumes that it's head in your local and remote repositories.

So it's expected. It also *should* warn about the fact that the remote repository HEAD does not match. Does it not do that?

Anyway, in general, you should always use a branch-name for "git request-pull", since you use branches. The "no branch name" is really only meant for the very original kind of git workflow where you don't use branches at all. Some people still do that (David Miller seems to prefer separate repositories over multiple branches, for example), but it's starting to be unusual.

Also, if your local branch is named differently from your remote one, you need to use the same format as you would have done for "git push" to push it out, so you'd do

git request-pull remote-repo local-branch-name:remote-branch-name

but quite frankly, I wouldn't recommend that workflow. I think it's too prone to mistakes.

Quoted 2 lines

FWIW, the main inconvenience with git request-pull is that it still needs s/[email protected]:/git:\/\/git.kernel.org/ postprocessing.

So what I always do on all my repositories is that "origin" ends up being the public thing, and then I have a separate set of things I push to.

Now, the reason I do that is that pushing is different from pulling, not only because of the whole security thing, but because I push to multiple repos.

So my .gti/config looks roughly like this:

[remote "origin"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]
remote = origin
merge = refs/heads/master

[remote "all"]
url = ra.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux url = [email protected]:torvalds/linux.git

and that means that when I pull from my own remote (which I actually do when I travel - it's hoe I synchronize my laptop and desktop), I use origin. And when I push, I do "git push all", and it pushes to both kernel.org and to the github "mirror".

And a plain "git push" simply won't work, which is fine.

Linus

#6 lore raw
In reply to Al Viro
Quoted 10 lines · Al Viro

FWIW, the main inconvenience with git request-pull is that it still needs s/[email protected]:/git:\/\/git.kernel.org/ postprocessing. It mimics the git push, but the remote you are pushing to probably won't be usable for pulling by others. Looks like it would be useful to have something like
pull_url = git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git
to go with
url = [email protected]:/pub/scm/linux/kernel/git/viro/vfs.git
in .git/config, settable by something in git remote. OTOH, it's possible to emulate by setting an extra remote and using git push vfs <...> for pushes, while doing git request-pull origin vfs-pull <...> for pull requests...

Isn't "pushurl" for that? I have:

[remote "origin"]
url = git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git
pushurl = gitolite.kernel.org:/pub/scm/linux/kernel/git/tomba/linux.git fetch = +refs/heads/*:refs/remotes/origin/*

Tomi