Re: Fetching SHA id's instead of named references?

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

 



7 apr 2009 kl. 04.34 skrev Nicolas Pitre:

In git terms, this is called "history rewriting". And you really don't
want to do that if your repository is pulled by other people, unless
there is an explicit statement about that fact.

I thought you had to use filter-branch to qualify for history rewriting? Anyway, the scenario I have in mind is when a new branch is created from the old one, the old one deleted and then the name of the old one gets reused. The deltas are still there, intact, but now you have to use a different named reference to reach them :-(

Thing is, with the distributed nature of git, nothing prevents you from keeping a local version of the commit you're interested in. Unlike with a central repository where someone else might delete a branch you need,
with git you will still have access to that particular commit locally
regardless if the remote repository has deleted it or not.

This is true, and Git is indeed very good at saving your ass on the client side. Other systems spend much more effort on saving your ass on the server side. My problem is that "my" people responsible for the overall system are mostly interested in the server side. At least that is where they put the tough requirements on perpetual availability.

However, it is good enough if there is some way to somehow guarantee that a branch or tag will never be misused as outlined above. This could be solved through basic file system mechanisms (like write protecting the refs/tags files perhaps?) or a backup mechanism that raises an alarm on forbidden manipulations, or a host of other more or less weird mechanisms. Git doesn't have to provide the mechanism directly, but it would be nice for enterprise users if it did.

There is nothing a tool can do for you if someone is determined to be
stupid with it.  In other words, don't delete a branch if it contains
important stuff. You may rename it if you wish. And if you don't want to fetch everything then you may always find out about the right branch
to pull with "git branch --contains <SHA1>".

This is all very true. And I wasn't aware of the --contains switch before. That one covers an entire scenario for me. Thanks!!

BR / Klas

--
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]