Re: New orphan worktree?

2 messages, 2 authors, 2021-01-06 · open the first message on its own page

Re: New orphan worktree?

From: Junio C Hamano <hidden>
Date: 2021-01-06 22:16:40

Jim Hill [off-list ref] writes:
On Wed, Jan 6, 2021 at 1:32 PM Junio C Hamano [off-list ref] wrote:
quoted
a need to have multiple unrelated line of histories in a single
repository may not be there, even though a desire to do so might
exist.  What is done with these unrelated histories that record
unrelated contents [*1*]?
Git itself is an example of other reasons for carrying disjoint dags as a
set of related histories.
Thanks, it is a good example why a repository may want to have
unrelated histories stored in it, but it is not a good example to
support the use of the "--orphan" option.

Histories for gitk, git-gui and todo come from different local
repositories.  gitk and git-gui histories come to my (local)
repository by pulling from separate repositories that have only
unrelated histories, and the todo branch does not exist even in my
local repository working on git codebase.

You see git, gitk, git-gui histories in a single repository but
these independent histories originate from and worked on each
separate repositories.  You see the todo history in the same
repository as these other three lines, only because I used to have
just a single publishing repository I can push into at kernel.org.

And none of the management above has any need to use "--orphan".

"gitk" and "git-gui" are worked in their own repositories, that do
not even have any commits of "git" history.  "todo" is worked in its
own repository, that do not even have any commits of "git" history.
The former two are pulled into my "git" repository and pushed out to
the public repositories.  The last one is pushed directly from my
"git-todo" repository and pushed out.

Re: New orphan worktree?

From: Jim Hill <hidden>
Date: 2021-01-06 22:26:29

On Wed, Jan 6, 2021 at 2:15 PM Junio C Hamano [off-list ref] wrote:
not a good example to support the use of the "--orphan" option.
I agree with that part, slathering infrastructure and abstractions on
oneliners (okay, twoliners) is suspect in my book. worktree add,
symoblic ref (really, no need to get lowlevel there, checkout --orphan
does it) done. Tag an empty commit and the sequence gets closer
to a legit oneliner

    git worktree add foo empty; git -C foo checkout --orphan newbranch
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help