Re: [PATCH] (trivial) add helpful "use --soft" for bare reset

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

 



David Fries <david@xxxxxxxxx> writes:

> But at work push -f no longer works, it's administratively denied from
> remote for certain branches, the kind that you generally never want to
> rewind.  But on occasion we do.  The options are to administratively
> change permissions, push -f, change back, or login to the server,
> clone, push -f, or manipulate the bare repository directly.  Modifying
> the bare repository is the quickest and git-update-ref works, it just
> isn't in the porcelain commands, so less likely to be known.

That is expected. Whoever denies "administratively" a push that rewinds
the history would have the authority to grant exception to the policy, and
ability to help you rewind the history. You would need to work with
them. If "them" happens to be "you", then you are expected to have that
authority and ability, which may include to have direct write access to
the repository and to know update-ref.

> ....  I'm not concerned about a user
> actually being in a bare repository thinking they're not, because
> resetting the index or working directory can loose information that
> you can't get back by looking at the ref-log until gc runs, and
> nothing woring on the index or working directory will work so they'll
> figure it out soon enough.

You may not be concerned, but I am; otherwise the message you are
responding to wouldn't have been written. And I would agree they'll figure
it out soon enough with the current error message, that does not have an
advice to look at update-ref, which is irrelevant. I am mostly worried
about the additional wrong (for their situation) advice throwing them off
track.

>> In such a scenario, the mistake is not that I used a wrong command "reset"
>> in an attempt to update the tip of the branch. The mistake is that I tried
>> to use the right command to update the index, but I did it in a wrong
>> place. "Did you mean to do that somewhere else?" would be a much more
>> appropriate advice in that case.
>
> Yes, your message would be appropriate in that case, but there's no
> way for git to guess that.

That is exactly my point. If we cannot guess reliably, I do not want to
see us giving an inappropriate advice that does not apply to the user's
situation, potentially leading the user in the wrong direction.

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