git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* new file leaked onto release branch
@ 2005-12-14  7:57 Len Brown
  2005-12-14  8:37 ` Junio C Hamano
  2005-12-14  9:39 ` Junio C Hamano
  0 siblings, 2 replies; 23+ messages in thread
From: Len Brown @ 2005-12-14  7:57 UTC (permalink / raw)
  To: git

I'm suspecting that this issue is technically a pilot error of me issuing
git-updated-index at the wrong time, but perhaps the list
should be aware of this type of issue.  And perhaps somebody
can suggest a better work flow that is immune to this?

Somehow a new file leaked from my "acpica" branch onto my "release" branch
without me pulling "acpica" into "release".

I use the latest git and I follow Tony's Documentation/howto/using-topic-branches.txt.

The new file, rsinfo.c,  was added in one of the patches in the acpi branch,
but then was sucked into the release branch in this commit:
9115a6c787596e687df03010d97fccc5e0762506
which is on the release.broken branch of this tree:
git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git

Even though the file didn't exist on either of the parents of the merge.

I think I probably did a git-update-index while working on the acpica
branch, and then git remembered that while I was on the release branch
doing a routine pull from linus to make sure I was up-to-date before
doing a push to kernel.org.

why did I do this?

I use quilt to manage a stack of patches in my repo.
I like to build them on several build machines (i386, x86_64, ia64)
before doing a git commit.

I package up a tar-file for the remote machines with
git-tar-tree $BRANCH $REPO | gzip -1 > $TARFILE
But I still need to generate a patch containing all the local
changes that I haven't checked into git yet.

git diff > my.patch
does this for me.  But when it failed to pick up a new file,
I manually did a git-update-index --add IIR, and that seems
to be how rsinfo.c got sucked into the subsequent git pull from linus.

perhaps somebody has a better idiom for packaging up a  current
working tree for a remote build machine to crunch on it?

thanks,
-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14  9:41 Brown, Len
  0 siblings, 0 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14  9:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>> I package up a tar-file for the remote machines with
>> git-tar-tree $BRANCH $REPO | gzip -1 > $TARFILE
>> But I still need to generate a patch containing all the local
>> changes that I haven't checked into git yet.
>
>Let me understand what you have correctly:
>
>    You have the latest commit, changes needed to be tested in
>    working tree, and index is somewhere in-between, because of
>    "git-update-index --add" you did for patch generation; but
>    ideally you would want to keep HEAD and index in sync.

Right, I updated the index so that git diff would work.

I guess I don't really have my head around the index concept.
Yes, it seems perhaps that HEAD and index disagreeing about what is
in the repo is what caused the problem at hand.

>And you need a way to do the above tar-tree + patch equivanent
>to move what you have in your working tree to other machines for
>pre-commit testing.  Some random thoughts on ways to do it.
>
>(1) NFS with "make O=dir/to/store/output/files/"?

I think I prefer the build boxes to be more independent.

They build about a dozen kernels from scratch each,
so I can't really keep my working repo frozen for
the duration of the builds.

Also, sometimes I have them building different branches
and different versions, depending on what is going on.

Also, sometimes I apply a local test patch to the
build box that isn't (yet) shared with the other boxes.
 
>(2) Do you have git on other build boxes?  Perhaps
>
>    mainbox$ edit on "acpica" branch
>    mainbox$ git checkout -b build-test ;# branch from it
>    mainbox$ git add some files
>    mainbox$ git commit -a -m "Build test $(date)" ;# take all
>
>    mainbox$ ssh i386box
>    i386box$ git pull mainbox:/home/lnx/.git build-test
>    Fast forward.
>    i386box$ make ;# happy
>
>    mainbox$ git checkout acpica ; git pull . build-test ;# 
>fast forward

sure, I have git everwhere.  But check-in is not a lightweight
process for me -- I like to get the contributor & comments right
on the check-in as if I'm creating permanent history.  I hate
checking in a patch just to have to check in a build fix for
it 20 minutes later.

this is why I use quilt.  I just pop the patches, fix the
broken one, and push them back.  after build and boot tests,
that is when I do the git commit.

>(3) Tarball approach, but taking the local modifications along
>    as well:
>
>    mainbox$ git update-index all-changed-paths-not-just-add
>    mainbox$ git-tar-tree $(git-write-tree) $REPO | gzip >$TARFILE
>    mainbox$ git reset ;# unregisters all mods since HEAD from index
>    mainbox$ scp $TARFILE i386box:/home/lnx/
>
>I suspect the last one is the least disruptive to your existing
>workflow.

yes, this is along the lines of what I do now.
do these steps capture the changed uncommited source files in
my repo?

actually, since the mis-hap with the update-index, what I do now
is a make clean mrproper, move the .git directory out of the source tree
tar what is left, and then restore the .git directory...
this has the nice side effect of taking along the quilt patches directory,
and sometimes I've found it useful to do individual build/test
between patches in the quilt stack, though I'd probably lose track
of what I'm doing if I did that all the time.

thanks,
-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14  9:58 Brown, Len
  0 siblings, 0 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14  9:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1279 bytes --]

>What do you use to create these "Auto-update" commits, and how
>can I help you to fix it?

I use the attached script, which I pasted from
git/Documentation/howto/using-topic-branches.txt

git.update linus

to get the latest stuff from Linus onto the linus branch

git.update release

to pull linus branch into my release branch

git.update release

to pull linus branch into my test branch

I also use the git.merge script to pull topic branches
into either release or test, or to pull release into test.
I used git.merge to pull release into acpica because
acpica had fallen behind the base at one point, and this
may be where the issue happened.

in the case of the acpica topic branch, it was not pulled
back into either release or into test after the file in question
was added.  Indeed, you can pull the acpica branch from the tree
on kernel.org.

I'm trying to remember if there were git error message along the way.
I do remember an issue with a commit where I had re-named a file
and git didn't recognize it as such.  so I put this in my git.commit
wrapper:

git-udpate-index --add --remove `quilt files`
git commit

dunno if that may be related to the issue at hand.
I don't really understand this index stuff...

thanks,
-Len

[-- Attachment #2: git.update --]
[-- Type: application/octet-stream, Size: 624 bytes --]

#!/bin/bash
# Update a branch in my GIT tree.  If the branch to be updated
# is "linus", then pull from kernel.org.  Otherwise merge local
# linus branch into test|release branch

case "$1" in
test|release)
        git checkout $1 && git merge "Auto-update from upstream" $1 linus
        ;;
linus)
        before=$(cat .git/refs/heads/linus)
        git fetch linus
        after=$(cat .git/refs/heads/linus)
        if [ $before != $after ]
        then
                git-whatchanged $after ^$before | git-shortlog
        fi
        ;;
*)
        echo "Usage: $0 linus|test|release" 1>&2
        exit 1
        ;;
esac

[-- Attachment #3: git.merge --]
[-- Type: application/octet-stream, Size: 549 bytes --]

#!/bin/bash
# Merge a branch into either the test or release branch

pname=$0

usage()
{
        echo "Usage: $pname branch test|release" 1>&2
        exit 1
}

if [ ! -f .git/refs/heads/"$1" ]
then
        echo "Can't see branch <$1>" 1>&2
        usage
fi

case "$2" in
test|release)
        if [ $(git-rev-list $1 ^$2 | wc -c) -eq 0 ]
        then
                echo $1 already merged into $2 1>&2
                exit 1
        fi
        git checkout $2 && git merge "Pull $1 into $2 branch" $2 $1
        ;;
*)
        usage
        ;;
esac

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 18:27 Brown, Len
  0 siblings, 0 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14 18:27 UTC (permalink / raw)
  To: Linus Torvalds, Junio C Hamano; +Cc: git

 
>Len, how old a git are you using? "git-merge" really should 
>_never_ have done this, but old (and I mean really old)
>git merges sometimes got confused with the base parent
>and would create a merge even when it was unnecessary.

should be the top of tree on the day the merge was made.

I generally pull from git://git.kernel.org/pub/scm/git/git.git
at the beginning of the day, build it and install it.

Right now git --version answers 0.99.9.GIT

-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 19:20 Brown, Len
  2005-12-14 20:10 ` Linus Torvalds
  2005-12-14 20:45 ` Junio C Hamano
  0 siblings, 2 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14 19:20 UTC (permalink / raw)
  To: Linus Torvalds, Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]

 
>So Len, since you seem to use "git merge" in your scripts, I 
>suspect you have an old version of git lying around. Can you try doing just

Should I be using something different than git merge?
is Documentation/howto/using-topic-branches out of date?

>	git merge-base -a 
>0a47c906342e2447003e207d23917dfa5c912071 
>d2149b542382bfc206cb28485108f6470c979566
>
>to see what the result is for you?

$ git merge-base -a 0a47c906342e2447003e207d23917dfa5c912071 d2149b542382bfc206cb28485108f6470c979566
d2149b542382bfc206cb28485108f6470c979566

>Also, maybe the _reason_ you have an old git lying around is 
>that you have two installations

Doesn't appear to be the case, as I don't have a /usr/bin/git
IIR, months ago I tried to install the rpm and
it failed due to some incompatibility like not groking
a SuSE destination.  I got Dave's git tarball according
to Jeff's howto: http://linux.yyz.us/git-howto.html
and have been building and installing from a git repo since.
(I found git-current tarball dated 7/21/05, so maybe it was then)
I did, however a few months ago copy my i386 home directory over to the
x86_64 box I use now, re-build and re-install.  Dunno
if there may have been a hickup in that process...
I found a backup copy of my i386 bin directory from 2005-08-25 --
binaries still in i386 format.  But I don't think I ran that b/c
it isn't on any PATH.  Git lives in ~/bin which is 1st in my PATH.

I think the lesson I'm taking away from this is that
as I continue to stumble forward using git I should
immediately report anything that doesn't look quite right
while I can still guarantee that all the clues are still
at the scene of the crime.  I expect that I've re-built
and re-installed git several times since the merge
in question was made.

-Len

[-- Attachment #2: to-linus --]
[-- Type: application/octet-stream, Size: 141 bytes --]

git merge-base -a 0a47c906342e2447003e207d23917dfa5c912071 d2149b542382bfc206cb28485108f6470c979566
d2149b542382bfc206cb28485108f6470c979566

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 21:31 Brown, Len
  0 siblings, 0 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14 21:31 UTC (permalink / raw)
  To: Tom Prince, Junio C Hamano; +Cc: Linus Torvalds, git

>> I pointed out one anomaly which is the commit should never have
>> been created because it was not even a fast forward but already
>> up-to-date case, and it was followed up with exchange of a few
>> messages between Linus and you.
>> 
>
>I don't remember any of the details now, but I remember that an old
>version of git or cogito would create bogus fast-forward 
>merges, if they
>were used without GNU coreutils. The machine it happend on was running
>FreeBSD 4.10, but current versions work fine.

I'm running SuSE Linux 10.0 x86_64 on this box
# rpm -q coreutils
coreutils-5.3.0-20

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 21:51 Brown, Len
  0 siblings, 0 replies; 23+ messages in thread
From: Brown, Len @ 2005-12-14 21:51 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Junio C Hamano, git

 
>That's what I get when I try this:
>
>	git checkout -b test-merge 0a47c906342e2447003e207d23917dfa5c912071
>	git merge "Testing merging" HEAD d2149b542382bfc206cb28485108f6470c979566
>
>results in a very immediate
>
>	"Already up-to-date."
>
>message. Does it do that for you too?

Yes.

>I think this list has been pretty responsive to reports of strange 
>behaviour, so yes. 

Agreed.
If I see anything strange like this in the future I'll report it immediately.

thanks,
-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 22:06 Brown, Len
  2005-12-14 22:16 ` Junio C Hamano
  0 siblings, 1 reply; 23+ messages in thread
From: Brown, Len @ 2005-12-14 22:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Linus Torvalds, git

 
>I pointed out one anomaly which is the commit should never have
>been created because it was not even a fast forward but already
>up-to-date case, and it was followed up with exchange of a few
>messages between Linus and you.  But even if we got that mixed
>up, the resulting merge should not have contained the file
>neither parents had.  That part worries me the most.
>
>One question.  You mentioned these in your message, you have
>a "git.commit wrapper" that contains these lines:
>
>    git-update-index --add --remove `quilt files`
>    git commit
>
>I am not familiar with 'quilt', but is "quilt files" the command
>to show the list of files with patches applied to the working
>tree?

yes, but only by the last applied "on the top of the stack."
When I do a commit, there is only 1 patch applied so this works okay.
(then I push the next patch after the commit and repeat...)

>If so, the above do tell git about the modified (including added
>or removed) files that the applied quilt patches touch, which
>sounds like the correct thing to do.
>
>But the resulting commit from that procedure would not be a
>merge commit, and the commit in question that had the rsinfo
>file magically appeared from nowhere is a merge, so this does
>not seem to have much to do with the current problem...
>
>Still puzzlled, sorry.

I'm not stuck by this problem, since I created a new release
branch based before the funny merge and it seems to be
working properly.  I'm sorry I can't re-create the problem
again.  Next time something like this happens and I notice it
I'll be sure to keep the ingredients for the failure on hand.

thanks,
-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-14 22:48 Brown, Len
  2005-12-14 23:34 ` Johannes Schindelin
  0 siblings, 1 reply; 23+ messages in thread
From: Brown, Len @ 2005-12-14 22:48 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>BTW, are 5165, 3410, 5452, 5571... topic branch names?

yes, the are bugzilla ids

^ permalink raw reply	[flat|nested] 23+ messages in thread
* RE: new file leaked onto release branch
@ 2005-12-19  3:21 Brown, Len
  2005-12-19  9:16 ` Junio C Hamano
  0 siblings, 1 reply; 23+ messages in thread
From: Brown, Len @ 2005-12-19  3:21 UTC (permalink / raw)
  To: Junio C Hamano, Linus Torvalds; +Cc: git

 
>This theory however does not seem to match what really happened.
>Len did mention that he has "5165" branch (there is a commit
>marked "Pull 5165 into release branch" near a problematic
>merge), but he did not say he also has a 5165 tag; the bug does
>not trigger if you do not have the tag of the same name.  Also
>if this theory holds true, the problematic commit should have a
>commit whose object name begins with 5165 as the second parent
>but that is not the case.  And the problem happened with a
>commit that is not a merge between release/test and topic
>branch anyway; it is with an "Auto-update from upstream" commit.

Per Tony's topic-branches howto, I do plenty of branching,
where the topic branch name , #### below , is a 4-digit number:

git checkout -b #### linus

and I use the wrapper script to do this:

git checkout test && git merge "Pull #### into test branch" test ####
git checkout release && git merge "Pull #### into release branch" release ####


But
1. I don't create tags with #### names, indeed, I never use tags at all
2. I agree that while #### names may be an area of a potential
   problem, it may not be related to the observed failure.  This is
   because the file in question was added to to a topic branch called "acpica"
   which IIR never interacted in any way with a branched named ####,
   but only with the branches called "linus" and "test".

>So I am still puzzled by the "where did this file come from"
>problem.  The most plausible explanation was the driver error
>mentioned already in the thread: "update-index --add" in the
>middle of merge with manual committing.

I too suspect that a failed automatic merge is related.
Likely the sequence of events is not something that either
a git expert or a git beginner would ever issue, but takes
somebody like me who knows just enough to be dangerous:-)

-Len

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2005-12-19  9:16 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-14  7:57 new file leaked onto release branch Len Brown
2005-12-14  8:37 ` Junio C Hamano
2005-12-14  9:39 ` Junio C Hamano
2005-12-14 16:26   ` Linus Torvalds
2005-12-14 16:53     ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2005-12-14  9:41 Brown, Len
2005-12-14  9:58 Brown, Len
2005-12-14 18:27 Brown, Len
2005-12-14 19:20 Brown, Len
2005-12-14 20:10 ` Linus Torvalds
2005-12-18  7:08   ` Junio C Hamano
2005-12-14 20:45 ` Junio C Hamano
2005-12-14 21:26   ` Tom Prince
2005-12-14 21:31 Brown, Len
2005-12-14 21:51 Brown, Len
2005-12-14 22:06 Brown, Len
2005-12-14 22:16 ` Junio C Hamano
2005-12-14 22:48 Brown, Len
2005-12-14 23:34 ` Johannes Schindelin
2005-12-15  0:37   ` Junio C Hamano
2005-12-15  1:29     ` Johannes Schindelin
2005-12-19  3:21 Brown, Len
2005-12-19  9:16 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).