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

mg/rev-parse-option-sifter-deprecation

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 3, 2010, 18:25 UTC
Message-ID
<20100603182513.GA25093@progeny.tock>
In-Reply-To
<4C076A6C.601@drmicha.warpmail.net>
Hi,
Michael J Gruber wrote:
> Junio C Hamano venit, vidit, dixit 03.06.2010 01:36:
Show 6 quoted lines
>> Some people might interpret "Deprecate" too strongly; the intent is that
>> we shouldn't keep piling parsing of new rev-list options to it and
>> discourage the use of "option sifter" in new programs.
>
> So, s/deprecated/discouraged/? Is there an alternative we should suggest
> there for scripts needing to sift their options?
Ah, I was wondering about this, too.

Most git tools use parseopt now, whether they are written in sh or C. When I first read this deprecation, I thought, "Wait --- so rev-parse --parseopt is going away?" So it might make sense to mention rev-parse --parseopt separately in the description section.

As for --revs-only and --no-revs, the problem aiui is that we have no in-tree users for them except git filter-branch. Worse still, they share no code with setup_revisions(). Would it be sensible to change this?

 - teach setup_revisions() to use an option sifter instead of parsing
   options in one pass (probably a bad idea), or
 - give setup_revisions a second identity as an option sifter, or
 - teach filter-branch to do its own sifting of filespec arguments
   from revision arguments, and let rev-parse --revs-only rot

Unfortunately, any one of these changes would take time; so to be realistic, regardless of what else happens, the deprecation notice seems like the right thing to do.

| You can use linkgit:git-rev-list[1] directly or
| +linkgit:git-for-each-ref[1] for scripting.
I do not understand the reference to for-each-ref here.

Thanks, Jonathan

Previous: Michael J GruberNext: Clemens Buchacher
Message 8 of 23 in “What's cooking in git.git (Jun 2010, #01; Wed, 2)”
  1. Junio C HamanoJun 2, 2010
  2. Tay Ray ChuanJun 3, 2010
  3. 3/3 commit::print_summary(): set rev_info.always_show_header to 1Tay Ray Chuan, Jun 4, 2010
  4. Tay Ray ChuanJun 4, 2010
  5. Junio C HamanoJun 5, 2010
  6. commit::print_summary(): set rev_info.always_show_header to 1Tay Ray Chuan, Jun 7, 2010
  7. Michael J GruberJun 3, 2010
  8. mg/rev-parse-option-sifter-deprecationJonathan Nieder, Jun 3, 2010
  9. 1/2 separate quoting and relative path generationClemens Buchacher, Jun 3, 2010
  10. 2/2 ls-files: allow relative pathspecClemens Buchacher, Jun 3, 2010
  11. Junio C HamanoJun 3, 2010
  12. optimize path_relative()Clemens Buchacher, Jun 4, 2010
  13. Clemens BuchacherJun 4, 2010
  14. setup: document prefixClemens Buchacher, Jun 5, 2010
  15. optimize path_relative()Clemens Buchacher, Jun 5, 2010
  16. Junio C HamanoJun 5, 2010
  17. Thomas RastJun 3, 2010
  18. Eyvind BernhardsenJun 3, 2010
  19. Jonathan NiederJun 4, 2010
  20. Junio C HamanoJun 5, 2010
  21. Jonathan NiederJun 5, 2010
  22. Sverre RabbelierJun 5, 2010
  23. Junio C HamanoJun 6, 2010

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.