Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:57:22+00:00 2026-05-23T11:57:22+00:00

I’ve set up a repository that is served through apache2. Users first need to

  • 0

I’ve set up a repository that is served through apache2. Users first need to authenticate to apache in order to read / write to the repository.
I has come to my attention, that if users set some crazy name as ‘username’, this name will used for the commit – and not the apache authentication name.

Now, is there a way so that either

  • the username is replaced by the apache login name?
  • or I add the apache login name to the username as defined in the commit?

I know that subversion & apache will always use the apache login name, so that should be possible with mercurial too, right?

EDIT:
I think what I need is to write a hook which extracts the http username and checks whether it matches the commit username. if it doesn’t, then the push request should be rejected.
Does anyone know how to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:57:23+00:00Added an answer on May 23, 2026 at 11:57 am

    This is the wrong approach to this, and is guaranteed to cause more headache and problems than whatever problem it is that you’re trying to solve right now.

    Let’s assume that you succeeded in implementing the proposed method, what would happen?

    Well, in my local repository, that I’m trying to push, I have changesets 1, 2, and 3, with hashes ABC, DEF and KLM. For some reason, I did not use the apache username when committing, so they’re wrong, according to your proposed changes.

    I push to the server.

    In-flight, your code changes my commits to have the apache username instead. This causes the hashes of those changesets to become recalculated, and different. In other words, my changeset 1, 2, and 3 will now have hashes XYZ, DEF and JKL.

    So now my changes are on the server. I did not get a conflict during push since I was the last person cloning.

    However, if I now try to pull, I now suddenly discover there are 3 changesets I don’t have, so I pull those, and discover that I now have those 3 changesets in parallel with the 3 I had, with the same contents, a different committer name, and different hashes.

    This is how every push and pull will behave from now on.

    You push, and immediately you can pull the “same” changesets back, with new hashes, in a parallel branch to yours.

    And now the fun begins. How does your local client discover how what to push? It asks the server, “what do you have?”, and then compare that. Well, the server still doesn’t have your 3 original changesets, so the outgoing-command is going to figure, well, those 3 changesets should be pushed.

    But if you try to push that, you then recreate the same 3 new changesets, which can’t be pushed, so you’re going to have troubles with that.

    What you have to do is impose the following workflow on your users:

    1. Push the new changesets
    2. Pull the new changesets back, in their new form
    3. Strip out the original changesets that was pushed

    A better approach would be for the server to prevent the push in the first place, with a message about using the wrong commit name.

    Then you place the burden on the user to fix those changesets before trying to push, for instance by importing them into MQ and reapplying them one at a time.

    Or… not.

    What if I do a pull from you? You fix a bug, and you’re not yet ready to push everything to the server, so you allow me to pull from you, and now I have outgoing changesets with your name on it, and a server that will enforce my name on them all.

    About now you should realise that this approach is going to cause a lot of problems, you’re basically trying to make a distributed version control system behave like a centralised version control system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to apply a triggered animation to all ToolTip s in my app,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want use html5's new tag to play a wav file (currently only supported
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.