[llvm-dev] I've intertwined two branches

David Lloyd via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 8 10:00:55 PDT 2021


Branches are just a pointer to a commit ID.  This just means that your
local `main`, `lists`, and `assert` branches all point to the same commit
ID, which is OK.  Pushing one does not push the others.  When you push a
branch e.g. `lists` via `git push origin lists`, what you are doing is
telling the remote server "create or change the branch (pointer) on your
end called `lists` to refer to the same commit ID as my local branch
`lists`".  It also pushes the commits to the server (but this is strictly
additive - nothing is lost by this action).  No other remote branches would
be affected by this action.

It's also possible to push a local branch to a remote branch with a
different name; e.g. `git push origin foo:bar` makes a branch called `bar`
on the remote side with the same commit ID as the branch called `foo` on
the local side.

Overall I don't think you've broken anything, it's just that the log output
is not completely intuitive.  It's just listing all the branch names that
it knows of which happen to point to the corresponding commit ID in the log.


On Thu, Apr 8, 2021 at 11:48 AM Paul C. Anagnostopoulos via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> When I check out the main branch, do a pull --rebase, and ask for a log, I
> see the following. That line with '(lists, assert)' seems funky.
> c:\llvm\llvm-project> git log --oneline -30
> 2690d4d45a63 (HEAD -> main, origin/main, origin/HEAD) [MLIR] Support
> symbols in emptiness checks for FlatAffineConstraints
> e10493eb5012 [DebugInfo] Correctly track SDNode dependencies for list
> debug values
> e184eeaa3ba1 [AMDGPU] Add some implicit uses to tests. NFC.
> a1a372dfb526 [AMDGPU] SIFoldOperands: remove an unneeded isReg check. NFC.
> 2cb8c10342ee Revert "Reduce the number of attributes attached to each
> function"
> 466fab5c9410 [lsan] Mark 2 new lsan tests unsupported on arm-linux
> 2ecf928153fc [lldb/DWARF] Fix a crash parsing invalid dwarf (pr49678)
> 1e511bb1be71 [lldb] Re-skip TestVSCode_launch
> 9229465bad85 [NFC] Fix warning introduced in
> 20105b6b4874a85813f7a4a3d8ad2a0f023dda14
> a250e91d1034 [AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
> 2724b57ecdbb [AMDGPU] SIFoldOperands: remove an unneeded
> make_early_inc_range. NFC.
> c28f79a0e335 [AMDGPU] SIFoldOperands: try harder to fold cndmask
> instructions
> e4de3cdf3d66 [LV] Pass VPWidenPHIRecipe to widenPHIInstruction (NFC).
> 9f0d8bac144c [analyzer] Fix dead store checker false positive
> b785e03612d7 Support: mapped_file_region:  Pass MAP_NORESERVE to mmap
> 3344cd3a1477 [AMDGPU] SIFoldOperands: make tryFoldCndMask a member
> function. NFC.
> c10cc4ea2729 [AMDGPU] Fix computing live registers in prolog
> 6fccfd7cbdca [InstCombine] add icmp with no-wrap add tests; NFC
> 14580ce2fdd1 (lists, assert) [TableGen] Make behavior of list slice suffix
> consistent across all values
> 3b9a15d910a8 [TableGen] Add support for the 'assert' statement in
> multiclasses
> 1206313f82f8 [CodeGen][AArch64] Fix isel crash for truncating FP stores
> 5299843c3146 [mlir][spirv] Add control for non-32-bit scalar type emulation
> 004f29c0bb3c [mlir][spirv] Timely fail type conversion
>
> On 4/8/2021 11:01 AM, Stella Laurenzo wrote:
>
> Git happens to the best of us :)
>
> Since you've already pushed, upstream should be considered source of
> truth. If I were you, I would start a new branch, pull fresh from upstream
> and then git cherrypick commits you want to keep from your local branches
> into the new branch. The git reflog is your friend on this, especially if
> you start resetting, etc.
>
> Since I see you are on Windows, I recall some of these things to be fairly
> easy with the Forks git gui.
>
> There are probably better ways to repair, but for me, when I mess it all
> up, I find it easier to low tech reconstruct what I want vs advanced
> solutions.
>
> On Thu, Apr 8, 2021, 6:12 AM Paul C. Anagnostopoulos via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Somehow I have managed to intertwine two branches in my local repository.
>> They are 'assert' and 'lists'. Here is what I see:
>>
>>   Switched to branch 'assert'
>>   c:\llvm\llvm-project> git log2
>>   14580ce2fdd1 (HEAD -> assert, origin/main, origin/HEAD, main, lists)
>> [TableGen] Make behavior of list slice suffix consistent across all values
>>   3b9a15d910a8 [TableGen] Add support for the 'assert' statement in
>> multiclasses
>>    Switched to branch 'lists'
>>   c:\llvm\llvm-project> git log2
>>   14580ce2fdd1 (HEAD -> lists, origin/main, origin/HEAD, main, assert)
>> [TableGen] Make behavior of list slice suffix consistent across all values
>>   3b9a15d910a8 [TableGen] Add support for the 'assert' statement in
>> multiclasses
>>
>> I have no idea how I did this. Unfortunately, I ended up pushing both
>> revisions when I meant to push only the 'lists' branch. I could use some
>> help sorting out my local repository.
>>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


-- 
- DML • he/him
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210408/51d08123/attachment-0001.html>


More information about the llvm-dev mailing list