Re: [RFC/PATCH] Add multiple workdir support to branch/checkout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay wrote:

> I guess it depends what you mostly use your workdirs for. For me, it's 
> to have different branches checked out, not to have the same branch
> checked out in multiple locations. 

I find those both use cases for workdirs to fit perfectly in my usual workflow 
(web development).

- Different branches checked out
I've a cloned repo of a CMS and I use git-new-workdir to checkout different 
branches and tags, so to have available a few workdirs of recent versions, which 
I "attach" by symlinks to my web development projects.

- Same branch checked out in multiple locations
This use case just came up recently, when I find out that I prefer to have two 
websites "attached" (via symlink) to two different workdirs of the same branch.
I could have "attached" both websites to the same workdir, but my idea of having 
the websites "attached" to different workdirs was to be able to do some 
development (i.e: to commit stuff) on one workdir, while keeping the other one 
"fixed" at some particular commit. 

Juno wrote:

> Careful. Git has survived without your patch series till now, as people
> learned to be careful when they use separate workdirs and avoid certain
> things, to the point that they are not necessarily aware that they are
> avoiding them (one good practice is to keep the HEADs of non-primary
> workdirs detached).

Jay wrote:

> Also, while I might recommend new-workdir to my coworkers with the
> advice "don't checkout the same branch in multiple workdirs", never in
> a million years would I say "use new-workdir, but make sure to only
> use a detached HEAD in the workdirs." The latter would make their
> actual HEADs explode. 

After reading this, I noticed that using git-new-workdir with detached HEAD in 
each workdir could fit my workflow very well. In some cases (the ones mentioned 
above), I find that I may not need to have a workdir for a branch (where I won't 
do work, so won't be committing there), but rather to have that workdir "fixed" 
at a particular commit. 
That being said, I also see that I would find useful to be able to 
update/advance this workdir (in a detached HEAD state, that is, "fixed" at an 
specific commit) to a newer commit or to a particular branch.

Bottom line: making git-new-workdir a more reliable & friendly tool that could 
fit in the workflows of both advanced and non-advanced users.

-----
Quick note about me: I am an "advanced n00b" on git usage (using it since one 
year ago), and a general non-advanced user (of git and git-new-workdir). In 
other words, a git user that could easily shoot itself in the foot.

Arrived here while looking for some info about git-new-workdir, and if it was a 
Bad Idea to have different workdirs of the same branch (ie. checkout the same 
branch on different folders), as the idea of recklessly committing on different 
workdirs for the same branch sounded like a recipe for disasters to me.

I find it git-new-workdir a really useful tool in my workflow, and prefer it 
over having many clones of the same repo, which will imply having to do 
configuration for remotes and push/pull operations, which are also mind-boggling 
tasks for non-advanced users.
-----

Thanks for reading.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]