It seemed innocuous enough, and certainly a nice gesture, when the U.S. Senate was asked to rename a federal building for a retiring Louisiana congressman.

It was just before dawn last Sunday and Sen. Mike Gravel (D-Alaska) was hurrying to call up the bill to put the name of Rep. Joe D. Waggonner Jr. (D-La.) on the building in Shreveport.

What Gravel did not mention was another nice gesture: Attached to the bill was an authorization of more than $1 billion to start more than 158 new public works water projects in 46 states.

Among the goodies were several for Alaska, including a hydroelectric power project on the Susitna River that could cost as much as $6 billion before completion.

Here, literally by dark of morning, Gravel was attempting to win passage of a bill that environmentalists have called one of the most flagrant pork-barrel exercise of recent years.

Gravel failed for the moment, but his effort set off a chain of events in those last 12 hours of the 95th Congress. Before the chain ended:

Sen. William Proxmire (D-Wis.) dropped a filibuster plan after he heard veiled threats of reprisal against legislation from his Banking Committee.

The Gravel dams-and-harbors bill was detached from the one honoring the retiring Waggonner and hooked to another bill providing federal aid for filling potholes on highways.

A freshman congressman, Rep. Allen E. Ertel (D-Pa.), took it upon himself to try to push the bill in its pothole disguise through the House at the last minute.

Other junior members of the House, alert to the ploy, pulled off a rather remarkable trick of their own and stopped Ertel in his tracks. The bill was killed.

Those last-minute pieces of legislative sleight-of-hand were typical of the pushing and showing during the final two days of this Congress.

But the death of the biennial omnibus rivers and harbors bill, a traditional work of election-year art when legislators get approval for favorite projects, meant something more.

It was a major coup for outgunned environmentalists who contended the bill would have severely undercut President Carter's efforts to alter national water policy. Carter wants to restrict water subsidies that he says have encouraged water waste.

"It's an extraordinary blow to that pork-barrel system," said Brent Blackwelder of the Environment Policy Center. "And it is a clear sign that any time they try to rush these things through at the last minute they'll have real trouble."

The real trouble for the omnibus water bill, however, began long before last weekend. It began when the House and Senate crammed in a variety of new twists to the old theme of getting as much as possible for the home district.

It included projects not yet studied or approved by the Army Corps of Engineers. It included projects that the corps already had declared uneconomic. It altered - but only selectively - traditional local cost-sharing formulas.

In the eyes of the critics, Proxmier summed it up as succinctly as anyone last Sunday. "An extraordinarily bad bill . . . a terrible waste for the tax-payer," he said on the Senate floor.

An additional wrinkle in this legislative execise was that although the House and Senate versions varied, a conference was not held to work out the differences.

The House and Senate Public Works committees left it to their staffs to meet and reconcile the bills. Senators and House members who voted on the measure Sunday never had a chance to see what they actually were authorizing.

Knowing there was no conference report and sensing that an effort would be more to slip the legislation through in the final hours, Blackwelder and his allies from the Sierra Club and the Izaak Walton League began knocking on doors last week.

The found help - Sens. Proxmire, Patrick Leahy (D-Vt.) and James Abourezk (D-S.D.), among others - who pledged to keep their eyes open for any moves to send through the bill.

The first came when Gravel, floor manager of the water legislation, called up the Joe D. Waggonner Jr. federal building bill.

The first came when Gravel, floor manager of the water legislation, called up the Joe D. Waggonner Jr. federal building bill.

Wait a minute, said Abourezk, who is retiring from the Senate and cared less if he ticked off one more colleague with his objections.

"Can we inquire what that thick stack of papers is?" he asked Gravel. The thick stack of papers turned out to be 35 pages of amendment to Joe D. Waggonner Jr. - the omnibus water bill.

"It is 5:30 in the morning and we have not slept since yesterday. What you have is too complicated to consider under this kind of circumstance," Abourezk said.

He then objected and Gravel was thwarted from bringing the measure before the Senate.

A little later, another try was made - this time by Sen. J. Bennett Johnston Jr. (D-La.), who wanted to see friend Waggonner memorialized. But by now, the water amendment and the bill passed.

A bill with 158 projects will not go away easily, so back it came at mid-afternoon. This time it was tagged on the Emergency Highway and Transportation Repair Act of 1978.

That was a bill to provide federal help for filling highway potholes caused by ugly winter weather. But the pothole provisions had been removed and water projects put in their place, leaving only an innocent-sounding title at the top.

But the tone in the Senate had changed.Abourezk read the fine print and discovered two South Dakota projects in the bill. He decided it wasn't so bad, after all, and removed his objections.

Proxmire, meanwhile, had been besieged all day long by senators who kept saying, "Bill, cut it out. Please let my project go through." And he had heard some threats toward legislation he wanted from his Banking Committee.

So Proxmire dropped his threat of objection and announced he would make "a brief statement." He then proceeded to harangue Gravel at length about the water bill.

The longer he talked, the shorter the day became and the closer Congress came to adjourning. And the more nervous freshman Allen Ertel became on the House side.

The bill contained a flood-protection project for Harrisburg, Pa., that Ertel wanted dearly. He wanted the Senate to pass the bill and send it to the House so an effort could be made to bring it to a vote.

Ordinarily, the leaders of the House Public Works Committee - Reps. Harold Johnson (D-Calif.) and Ray Roberts (D-Tex.) - would have filled the role Ertel was playing Roberts had gone home; Johnson was keeping a low profile.

Ertel went to the Senate floor, talked to senators and tried to have the bill released. Proxmire, having had his say by late afternoon, finally sat down and the bill was passed by a voice vote.

On the House side, with adjournment nearing, Ertel stood and asked the speaker to suspend the rules and allow a vote on an emergency pothole bill.

Ertel didn't mention that the bill carried a certain little 35-page amendment, but the opposition was really and waiting for him.

One of the tips came when Gravel showed up unexpectedly around the House floor. Rep. John Seiberling (D-Ohio), still furious because Gravel earlier had upset a carefully crafted agreement on Alaska lands policy, saw the senator and asked about his mission.

As aides reconstructed it, Gravel said something like, "I'm here for the water bill." And Seiberling said something like, "Oh, really; we'll try to take care of it."

They did. On the floor, ReP. Robert Edgar (D-Pa.), an outspoken critic of pork barrel, raised an objection to the pothole bill.

In the discussion, Ertel conceded. "This is the pothole bill, but they took out the potholes and put in the water projects."

By then, time was running out and the House was anxious to quit. Ertel's moment had come - a vote swich, if two-thirds said yes, there would be flood protection for all the Harrisburgs of America.

But an objection was heard, a question of a quorum. A quorum call would become, in effect, a vote on the omnibus water bill. Seiberling, Edgar and others buttonholed colleagues. Don't answer the quorum, they urged.

Two hundred and sixty five did not answer, enough to prevent a quorum and passage of the bill. Next year, Harrisburg.