git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFD] Rewriting safety - warn before/when rewriting published history

From
Johan Herland <johan@herland.net>
Date
Feb 7, 2012, 15:09 UTC
Message-ID
<CALKQrge821x7OoSekkWw7vUjP642jhbE0D9oWPcCxuuTXOqQHA@mail.gmail.com>
In-Reply-To
<201202071531.08385.jnareb@gmail.com>

(we are pretty much in violent agreement, so I will only comment where I find it necessary)

On Tue, Feb 7, 2012 at 15:31, Jakub Narebski <jnareb@gmail.com> wrote:
Show 9 quoted lines
> Also, when thinking about different scenarios of why one would like to
> mark commit as 'secret', we might want to be able to mark commit as
> secret / unpublishable with respect to _subset_ of remotes, so e.g.
> I am prevented from accidentally publishing commits marked as 'secret'
> to public repository, or to CI/QA repository, but I can push (perhaps
> with warning) to group repository, together with 'secret'-ness state
> of said commit...
>
> ... though it wouldn't be as much 'secret' as 'confidential' ;-)

Another way to achieve this would be to have a config flag to control whether Git checks for the 'secret' flag before pushing. This config flag could be set at the system/user level (to enable/disable the feature as a whole), at the repo level (to enable/disable it in a given repo), at the remote level (to enable/disable it on a given repo), and finally at the branch level (to enable-disable it for a given branch (and its upstream)). Thus you could have a .git/config that looked like this:

  [core]
  refusePushSecret = true
  [remote "foo"]
  refusePushSecret = false
  url = ...
  fetch = ...
  [branch "baz"]
  remote = foo
  merge = refs/heads/baz
  refusePushSecret = true
This config would:
 - refuse to push 'secret' commits from branch 'baz'
(branch.baz.refusePushSecret == true)
 - but allow to push other branches with 'secret' commits to remote
'foo' (remote.foo.refusePushSecret == false)
 - but refuse to push 'secret' commits to other remotes
(core.refusePushSecret == true)

(The order of precedence would be: branch config > remote config > repo config > user config > system config > default when unset)

I am unsure whether the 'secret'-ness of a commit should follow across the push, but if you do (assuming we store the 'secret' flag using git-notes) this is simply a matter of synchronizing the refs/notes/secret to the same remote.

Have fun! :)
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Jakub NarebskiNext: Jakub Narebski
Message 17 of 34 in “[RFD] Rewriting safety - warn before/when rewriting published history”
  1. Jakub NarebskiFeb 4, 2012
  2. Ben WaltonFeb 5, 2012
  3. Jakub NarebskiFeb 5, 2012
  4. Steven MichalskeFeb 6, 2012
  5. Johan HerlandFeb 6, 2012
  6. Jakub NarebskiFeb 6, 2012
  7. Steven MichalskeApr 7, 2012
  8. Jakub NarebskiFeb 5, 2012
  9. Johan HerlandFeb 5, 2012
  10. Jakub NarebskiFeb 5, 2012
  11. Johan HerlandFeb 5, 2012
  12. Jakub NarebskiFeb 6, 2012
  13. Johan HerlandFeb 6, 2012
  14. Jakub NarebskiFeb 6, 2012
  15. Johan HerlandFeb 6, 2012
  16. Jakub NarebskiFeb 7, 2012
  17. Johan HerlandFeb 7, 2012
  18. Jakub NarebskiFeb 10, 2012
  19. Philip OakleyFeb 10, 2012
  20. Johan HerlandFeb 11, 2012
  21. Jakub NarebskiFeb 11, 2012
  22. [RFC] pre-rebase: Refuse to rewrite commits that are reachable from upstreamJohan Herland, Feb 20, 2012
  23. Johan HerlandFeb 20, 2012
  24. Junio C HamanoFeb 20, 2012
  25. Johan HerlandFeb 21, 2012
  26. Junio C HamanoFeb 21, 2012
  27. Johan HerlandFeb 21, 2012
  28. Junio C HamanoFeb 21, 2012
  29. Dave ZarzyckiFeb 21, 2012
  30. Jeff KingFeb 22, 2012
  31. Dave ZarzyckiFeb 22, 2012
  32. Steven MichalskeApr 7, 2012
  33. Steven MichalskeApr 7, 2012
  34. Ronan KeryellFeb 7, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.